Home > Adobe Flex > Flex 4: Changing the “displayAsPassword” default character

Flex 4: Changing the “displayAsPassword” default character

Today I ran into a situation where I wanted to display my password characters as a bullet versus the default asterisk (“*”).

I thought this would be pretty simple to do but realized after digging through the Flex 4 SDK that there was no public property I could set to change this. I tried hacking commitProperties and a couple of other methods but came up short in those areas as well until I found the exact spot in the Flex libraries where this character was defined:

RichEditableText.as (line 679)

1
2
3
4
    /**
     *  @private
     */
    mx_internal var passwordChar:String = "*";

A-ha! I see here that it’s prefixed with the “mx_internal” namespace and I remembered from other examples around the web that you can easily tap into that namespace and modify properties not normally meant to be modified.

Luckily, I had already extended the TextInput class for various other reasons and decided to add an event listener for the CREATION_COMPLETE lifecycle event of the component. This was added in the constructor:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import mx.core.mx_internal;
 
/**
 * Constructor
 */
public function myTextInput()
{
	super();
 
	this.addEventListener( FlexEvent.CREATION_COMPLETE, onCreationComplete );
}
 
private function onCreationComplete( event : FlexEvent ) : void
{
	//change internal passwordChar to a bullet versus an asterisk
	this.textDisplay.mx_internal::passwordChar = "●";
}

…and voila! By tapping into the mx_internal namespace, I found I could modify the normally private variable “passwordChar” and set it to something I preferred better (in this case, the bullet point used in some sites like Twitter).

Hope this helps someone!

Categories: Adobe Flex Tags:
  1. January 17th, 2025 at 09:59 | #1

    And there is no doubt that the actions of the opposition representatives only add fractional disagreements and are blocked in the framework of their own rational restrictions. But the high -tech concept of public way indicates the possibilities of priority requirements!

  2. January 17th, 2025 at 10:17 | #2

    Its like you read my mind! You appear to understand a lot about this, such as you wrote the book in it or something.
    I believe that you simply can do with a few percent to drive the message home a
    little bit, but other than that, this is fantastic blog.
    A fantastic read. I’ll certainly be back.

  3. January 17th, 2025 at 10:25 | #3

    Club Vibes 논현오피 (Houston)

  4. January 17th, 2025 at 10:48 | #4

    Given the current international situation, the innovation path we have chosen requires us to analyze the economic feasibility of decisions. A high level of involvement of representatives of the target audience is a clear evidence of a simple fact: the introduction of modern methods leaves no chance for the economic feasibility of decisions made.

  5. January 17th, 2025 at 11:08 | #5

    It’s in point of fact a nice and helpful piece of info.

    I am satisfied that you shared this helpful information with us.
    Please keep us up to date like this. Thank you for sharing.

  6. January 17th, 2025 at 11:08 | #6

    It’s very trouble-free to find out any topic
    on web as compared to books, as I found this paragraph at
    this web site.

  7. January 17th, 2025 at 11:12 | #7

    Hi colleagues, how is everything, and what you would like to
    say on the topic of this paragraph, in my view its genuinely awesome
    in favor of me.

  8. January 17th, 2025 at 11:13 | #8

    Сантехника купить Тюмень можно в магазинах города,
    предлагающих широкий ассортимент товаров для ванной комнаты
    и кухни. Удобные условия доставки и установки делают покупку комфортной.

  9. January 17th, 2025 at 11:20 | #9

    Hi, I do think this is a great web site. I stumbledupon it ;) I will come back once again since i have book
    marked it. Money and freedom is the best way to change, may
    you be rich and continue to help others.

  10. January 17th, 2025 at 11:23 | #10

    Hiring A Party Planner For Social Events 오피사이트 (Carmon)

  11. January 17th, 2025 at 11:26 | #11

    Social Club 하이오피주소

  12. January 17th, 2025 at 11:30 | #12

    4 Factors That Cause Starting An Online Shop 다바오홀덤

  13. January 17th, 2025 at 11:31 | #13

    Thanks for the marvelous posting! I genuinely enjoyed reading
    it, you can be a great author.I will remember to bookmark
    your blog and will come back someday. I want to encourage you
    to ultimately continue your great job, have a
    nice afternoon!

  14. January 17th, 2025 at 11:36 | #14

    Always check comprehensive data about product with
    the relevant seller and get to know/review certificates on disclosure of information – and norms and conditions, before making a
    decision on a https://msignawallet.com/.

  15. January 17th, 2025 at 11:45 | #15

    Five Some Tips For Running A Successful Corporate Event HiOP

  16. January 17th, 2025 at 11:48 | #16

    I am regular visitor, how are you everybody? This paragraph posted at
    this web site is in fact nice.

  17. January 17th, 2025 at 11:56 | #17

    I couldn’t resist commenting. Perfectly written!

  18. January 17th, 2025 at 11:58 | #18

    I am sure this paragraph has touched all the internet visitors,
    its really really fastidious article on building up new weblog.

  19. January 17th, 2025 at 12:05 | #19

    How To Play Marshall Poker 다바오 강아지 동반 호텔

  20. January 17th, 2025 at 12:14 | #20

    Thanks on your marvelous posting! I truly enjoyed
    reading it, you happen to be a great author.I will make certain to bookmark your blog and will come back sometime soon. I want
    to encourage continue your great work, have a nice day!

  21. January 17th, 2025 at 12:16 | #21

    Hmm it looks like your blog ate my first comment (it was super long) so
    I guess I’ll just sum it up what I had written and say,
    I’m thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new to the whole thing.
    Do you have any tips for rookie blog writers? I’d genuinely appreciate it.

  22. January 17th, 2025 at 12:31 | #22

    Truly all kinds of wonderful facts.

  23. January 17th, 2025 at 12:33 | #23

    It’s awesome to pay a visit this web page and reading the views of
    all colleagues concerning this article, while I am
    also eager of getting know-how.

  24. January 17th, 2025 at 12:38 | #24

    Have you ever considered publishing an ebook or guest authoring on other
    blogs? I have a blog based on the same ideas you discuss and would
    really like to have you share some stories/information. I
    know my readers would appreciate your work. If you are even remotely interested, feel free to send
    me an e mail.

  25. January 17th, 2025 at 12:39 | #25

    Body Massage OP (Bell)

  26. January 17th, 2025 at 12:41 | #26

    At this time it seems like WordPress is the top blogging platform available right now.
    (from what I’ve read) Is that what you are using on your blog?

  27. January 17th, 2025 at 12:48 | #27

    You reported this superbly!

  28. January 17th, 2025 at 12:55 | #28

    Day Spa: Useful Terminology Budal

  29. January 17th, 2025 at 12:55 | #29

    Wow, superb blog format! How long have you been running a blog for?
    you make blogging look easy. The whole glance of your site is magnificent, let
    alone the content material!

  30. January 17th, 2025 at 12:58 | #30

    I’m impressed, I have to admit. Rarely do I encounter a
    blog that’s both equally educative and interesting, and let me tell you, you have hit the nail on the head.
    The problem is something which not enough people are speaking intelligently about.
    Now i’m very happy I came across this in my search for something relating to this.

  31. January 17th, 2025 at 13:08 | #31

    I know this if off topic but I’m looking into starting my own blog and was curious what all
    is required to get set up? I’m assuming having a blog like yours would
    cost a pretty penny? I’m not very web smart so I’m not 100% positive.
    Any recommendations or advice would be greatly appreciated.
    Thanks

  32. January 17th, 2025 at 13:10 | #32

    I like the valuable information you provide in your articles.
    I will bookmark your weblog and check again here frequently.
    I’m quite certain I’ll learn many new stuff right here!
    Best of luck for the next!

  33. January 17th, 2025 at 13:15 | #33

    Hi, just wanted to say, I liked this blog post. It was helpful.
    Keep on posting!

  34. January 17th, 2025 at 13:16 | #34

    Hello! I could have sworn I’ve been to this blog before but after looking at some of the posts I realized it’s
    new to me. Anyways, I’m certainly happy I found it and I’ll be
    bookmarking it and checking back regularly!

  35. January 17th, 2025 at 13:21 | #35

    hey there and thank you for your info – I have definitely
    picked up something new from right here. I
    did however expertise some technical issues using this website,
    as I experienced to reload the site lots of times previous to I could get it to load correctly.
    I had been wondering if your web host is OK?
    Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and
    could damage your quality score if ads and marketing with Adwords.
    Well I am adding this RSS to my email and can look out for much
    more of your respective exciting content. Ensure that you update this again very soon.

Comment pages
1 102 103 104 435
  1. March 19th, 2014 at 11:13 | #1
  2. April 30th, 2014 at 01:00 | #2
  3. December 31st, 2018 at 08:24 | #3
  4. February 2nd, 2019 at 20:25 | #4
  5. January 25th, 2020 at 13:25 | #5
  6. March 28th, 2020 at 20:22 | #6
  7. March 30th, 2020 at 22:25 | #7
  8. July 2nd, 2020 at 04:14 | #8
  9. November 26th, 2023 at 17:35 | #9
  10. June 17th, 2024 at 01:33 | #10
  11. July 9th, 2024 at 09:52 | #11
  12. July 29th, 2024 at 03:40 | #12
  13. September 16th, 2024 at 11:50 | #13
  14. October 19th, 2024 at 15:31 | #14
  15. October 22nd, 2024 at 18:24 | #15
  16. October 24th, 2024 at 04:17 | #16
  17. November 9th, 2024 at 10:01 | #17
  18. November 9th, 2024 at 11:51 | #18
  19. November 11th, 2024 at 04:18 | #19
  20. November 11th, 2024 at 06:33 | #20
  21. November 11th, 2024 at 07:08 | #21
  22. November 12th, 2024 at 02:12 | #22
  23. November 13th, 2024 at 08:00 | #23
  24. November 14th, 2024 at 06:12 | #24
  25. November 14th, 2024 at 14:35 | #25
  26. November 14th, 2024 at 16:23 | #26
  27. November 15th, 2024 at 05:09 | #27
  28. November 15th, 2024 at 05:46 | #28
  29. November 15th, 2024 at 11:13 | #29
  30. November 15th, 2024 at 11:46 | #30
  31. November 15th, 2024 at 19:12 | #31
  32. November 17th, 2024 at 04:29 | #32
  33. November 18th, 2024 at 05:00 | #33
  34. November 19th, 2024 at 12:11 | #34
  35. November 19th, 2024 at 19:46 | #35
  36. November 25th, 2024 at 21:09 | #36
  37. December 4th, 2024 at 00:57 | #37
  38. December 30th, 2024 at 18:41 | #38
  39. January 6th, 2025 at 21:21 | #39