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.

  25. April 27th, 2017 at 16:07 | #25

    Fastidious replies in return of this issue
    with solid arguments and telling all about that.

  26. May 4th, 2017 at 17:15 | #26

    You need to be a part of a contest for one of the highest
    quality websites online. I am going to highly recommend this web site!

  27. May 10th, 2017 at 21:56 | #27

    Hi friends, itts wonderful artiicle regarding teachingand entirely explained, kee it up
    all the time.

  28. May 12th, 2017 at 12:59 | #28

    you’re truly a good webmaster. The web site
    loading speed is incredible. It kind of feels that you are doing any unique trick.
    In addition, The contents are masterwork. you’ve performed a excellent activity on this
    matter!

  29. May 13th, 2017 at 06:16 | #29

    Yes! Finally something about Garage Door California.

  30. May 15th, 2017 at 00:05 | #30

    I rarely leave a response, however I browsed some of the remarks on Flex 4:
    Changing the “displayAsPassword” default character | eonflex.com.
    I actually do have 2 questions for you if you do not mind.
    Is it only me or does it look as if like a few of the comments appear like they are coming from
    brain dead folks? :-P And, if you are posting at other sites,
    I’d like to follow everything new you have to post.

    Would you list of all of your shared sites like your Facebook page, twitter
    feed, or linkedin profile?

  31. May 17th, 2017 at 05:35 | #31

    magnificent points altogether, you just won a new reader.
    What may you suggest about your publish that you just made some days in the past?
    Any sure?

  32. May 19th, 2017 at 19:53 | #32

    hello!,I really like your writing so much! share we be in contact more approximately your post on AOL?
    I require an expert on this house to resolve
    my problem. Maybe that’s you! Having a look ahead to see you.

  33. May 21st, 2017 at 14:32 | #33

    The rebranding of the Alipay unit, whose authorized identify is Zhejiang Ant Small and Micro Financial Companies Group Co, is part of a method by Alibaba and its affiliated corporations to speed up improvement of monetary enterprise.

  34. May 23rd, 2017 at 17:10 | #34

    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 wrote and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to everything.
    Do you have any tips and hints for novice blog writers?
    I’d genuinely appreciate it.

  35. May 24th, 2017 at 16:22 | #35

    It’s hard to come by experienced people in this particular topic,
    but you seem like you know what you’re talking about! Thanks

  36. May 25th, 2017 at 16:48 | #36

    This piece of writing presents clear idea for the new viewers
    of blogging, that truly how to do blogging and site-building.

  37. May 26th, 2017 at 19:21 | #37

    Since then, the design of locks has advanced and incorporated new
    materials, such as steel, plastic, and other synthetic materials.

    • Don’t forget to check its compatibility with your building structure
    and the ability of the system to deliver a good sound quality which depends on the structure of your home.
    Keep away from any company which has a huge amounts of problems.

  38. June 1st, 2017 at 12:13 | #38

    It’s really a great and useful piece of info.
    I am satisfied that you simply shared this useful information with us.
    Please keep us informed like this. Thank you for sharing.

  39. June 1st, 2017 at 22:44 | #39

    What’s up, everything is going nicely here and ofcourse every one is sharing data, that’s truly
    excellent, keep up writing.

  40. June 2nd, 2017 at 00:51 | #40

    Simply desire to say your article is as surprising.

    The clearness in your post is simply nice
    and i could assume you’re an expert on this subject.
    Well with your permission allow me to grab your RSS feed to keep up
    to date with forthcoming post. Thanks a million and
    please continue the rewarding work.

  41. June 3rd, 2017 at 12:56 | #41

    Hey, wow, I am also going through chemo and you just put things into perspective really well for

  42. June 7th, 2017 at 19:54 | #42

    Hi to every one, the contents existing at this web site are
    truly amazing for people experience, well, keep up the good work
    fellows.

  43. June 17th, 2017 at 04:33 | #43

    It’s a shame you don’t have a donate button!
    I’d definitely donate to this superb blog! I guess for now i’ll settle for bookmarking and adding your
    RSS feed to my Google account. I look forward to fresh updates and will talk about this website with my Facebook group.
    Chat soon!

  44. June 18th, 2017 at 10:26 | #44

    Great post! We will be linking to this particularly great article on our
    site. Keep up the good writing.

  45. June 18th, 2017 at 15:33 | #45

    This article is truly a good one it assists new net people, who are wishing in favor of blogging.

  46. June 21st, 2017 at 08:20 | #46

    Hello to every one, it’s truly a good for me to pay a
    quick visit this website, it contains helpful Information.

  47. June 23rd, 2017 at 05:33 | #47

    Quality articles is the key to be a focus for the people
    to pay a quick visit the site, that’s what this site is providing.

  48. June 24th, 2017 at 06:14 | #48

    Meine Entwicklr auf rrden überzeugen versucht, mir zu .net vvon PHP zu bewegen. Ich war schon immrr mochte
    die Idee, weil dder Kosten Kosten. Aberr er ist tryiong nichtsdestoweniger.
    Ich habe mit Movable-Typ um mehreren verschiedenen Websitds
    für etwa ein Jahr und bin besorgt über die Umstellung auuf eine andwre Plattform.
    Dinnge über blogengine.net Ich habe sehr gut gehört.
    Gibt es einne Möglichkeit, ich kann import alle meine WordPress Beiträge hinein?
    Any Hilfe wäre wirklich sehr geschätzt!

  49. June 24th, 2017 at 08:18 | #49

    Great web site you have got here.. It’s hard to find
    quality writing like yours nowadays. I really appreciate people like
    you! Take care!!

  50. June 27th, 2017 at 22:31 | #50

    UV-C lighjt iss both a competent and effective method of controlling germs inn
    domestic and commercial environments. Determining expected
    growth rate of revenue and profits is meaningless if the success of your
    start-up is nott confirmed. They may not to produce new model
    monthly, but when they are doing release the next generation,
    it really is near flawless at its core.

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