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. March 8th, 2017 at 17:12 | #1

    Most e read­ers also settle for books downloaded from different stores without con­verting their format.

  2. March 10th, 2017 at 00:21 | #2

    I’m also commenting to let you understand of the incredible
    discovery our child enjoyed using yuor web blog. She picked up lots of things,
    most notably how it is like to have an incredible coaching character to get men and women easily
    completely grasp selected impossible subject matter.
    You really surpassed my expected results. Thanks for churning
    out such insightful, safe, explanatory and in addition unique tips
    about the topic to Gloria.

  3. March 13th, 2017 at 04:07 | #3

    That is really fascinating, You’re a very skilled blogger.
    I’ve joined your feed and look ahead to looking for more of
    your excellent post. Also, I have shared your site
    in my social networks

  4. March 13th, 2017 at 04:44 | #4

    Excellent blog you’ve got here.. It’s difficult to find good quality writing like yours nowadays.
    I honestly appreciate individuals like you!
    Take care!!

  5. March 13th, 2017 at 05:39 | #5

    更年期の症状でお困りの方へ。
    エクオールが効果的ですよ。
    更年期の症状が表れるのは、女性ホルモンが突然減少することが、原因です。
    そこでエストロゲンと同様の機能をするエクオールを飲めばいいんです。
    けれども日本人の50%は、腸の中で大豆製品をエクオールに変化させることができません。
    そこで大豆製品ではなく、エクオールの成分をダイレクトに飲むしかありません。

  6. March 14th, 2017 at 14:15 | #6

    Sіnce the admin оf thbis site іs ᴡorking, no uncertainty vеr soion it wiⅼl be renowned,
    due tto itѕ feature ϲontents.

  7. March 16th, 2017 at 02:47 | #7

    You could certainly see your skills in the article you write.
    The sector hopes for more passionate writers like you who aren’t afraid to mention how they believe.
    Always go after your heart.

  8. March 18th, 2017 at 11:36 | #8

    Hi to all, the contents existing at this website are genuinely amazing for people experience,
    well, keep up the nice work fellows.

  9. March 19th, 2017 at 07:25 | #9

    Your style is unique in comparison to other folks I’ve read stuff from.
    I appreciate you for posting when you’ve got the
    opportunity, Guess I will just bookmark this site.

  10. March 23rd, 2017 at 08:43 | #10

    Pediatric dentistry offices in Chicago deal will oral injuries like fractures and missing teeth as well.

    The pediatric dentist recommends the very best course of action to follow for the moms and dads.

  11. March 25th, 2017 at 10:08 | #11

    Surprisingly, Conductors research study inform us that over 50% of the
    Ton of money 500 business have NO organic search exposure for their most important paid search terms.

  12. March 27th, 2017 at 08:40 | #12

    What’s up, this weekend is pleasant in favor of me,
    as this moment i am reading this impressive educational
    article here at my house.

  13. March 27th, 2017 at 11:04 | #13

    It is not my first time to pay a visit this
    site, i am visiting this site dailly and take good data from
    here every day.

  14. March 28th, 2017 at 18:37 | #14

    You’re so cool!I do not think I’ve trulү rеad ѕomething like this
    before. So wonderfuⅼ to disсoᴠer somebody with original thoughts on this topic.
    Really.. many thanks fог ѕtarting this up.
    This web site is something that is needed on the internet, someone with some originalіty!

  15. March 29th, 2017 at 15:44 | #15

    Hello! I’m at work browsing your blog from my new iphone 4!
    Just wanted to say I love reading your blog and look forward
    to all your posts! Carry on the fantastic work!

  16. March 29th, 2017 at 19:02 | #16

    It’s in point of fact a great and useful piece of information. I’m satisfied that you shared this helpful info with us.
    Please stay us informed like this. Thank you for sharing.

  17. April 1st, 2017 at 07:59 | #17

    What i do not understood is actually how you’re
    not actually much more smartly-preferred than you might be right now.
    You are so intelligent. You realize therefore considerably when it comes to this topic, produced me
    individually imagine it from a lot of numerous angles. Its like men and women are not involved until it is one
    thing to do with Woman gaga! Your own stuffs nice. Always
    care for it up!

  18. April 3rd, 2017 at 05:58 | #18

    More about universal debt forgiveness and the approaching world debt
    jubilee could be discovered here The Saint Germain World Trust sources are extra to, and separate from,
    The World World Settlement Funds and the Global Collateral Accounts (pdf; 120pp).

  19. April 7th, 2017 at 10:41 | #19

    Self-love is not opposed to the love of other people. You cannot really love yourself and do yourself a favor without doing people a favor, and vise versa.

  20. April 8th, 2017 at 09:13 | #20

    It’s going to be ending of mine day, except before finish I am reading this fantastic
    piece of writing to improve my know-how.

  21. April 15th, 2017 at 09:06 | #21

    Attractive section of content. I just stumbled upon your website and in accession capital to say that I get actually
    enjoyed account your weblog posts. Any way I will be
    subscribing on your augment and even I success you get admission to persistently rapidly.

  22. April 16th, 2017 at 13:38 | #22

    You should be a part of a contest for one of the greatest sites
    on the internet. I’m going to highly recommend this web site!

  23. April 22nd, 2017 at 10:36 | #23

    Excellent way of explaining, and pleasant piece of
    writing to get facts on the topic of my presentation focus, which i am going to convey
    in institution of higher education.

  24. April 23rd, 2017 at 11:42 | #24

    I am genuinely glad to read this website posts which carries tons of useful data, thanks for providing these data.

Comment pages
1 9 10 11 435
  1. March 19th, 2014 at 11:13 | #1
  2. April 30th, 2014 at 01:00 | #2