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. September 22nd, 2018 at 19:48 | #1

    I know this site offers quality dependent
    posts and extra information, is there any other website which offers these information in quality?

  2. September 25th, 2018 at 10:37 | #2

    After I originally commented I appear to have clicked the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I receive four emails with
    the exact same comment. There has to be an easy method you can remove
    me from that service? Appreciate it!

  3. September 26th, 2018 at 07:02 | #3

    Helpful info. Lucky me I discovered your site by accident, and I’m surprised why this coincidence didn’t happened
    in advance! I bookmarked it.

  4. September 27th, 2018 at 11:06 | #4

    Howdy excellent blog! Does running a blog like this require a large amount of work?
    I have no understanding of programming however I had
    been hoping to start my own blog in the near future. Anyways, should you have any suggestions or techniques for new blog owners please share.
    I understand this is off subject but I just needed to ask.
    Thanks a lot!

  5. September 27th, 2018 at 11:23 | #5

    Wow, amazing weblog layout! How long have you been running a blog for?
    you made running a blog glance easy. The entire look of your website is great, as smartly
    as the content material!

  6. September 30th, 2018 at 02:39 | #6

    You actually make it appear so easy with your presentation however I to find this topic to be actually
    something which I feel I would by no means understand.
    It sort of feels too complicated and extremely vast for me.
    I am taking a look forward to your subsequent put up, I’ll attempt to get the hold of it!

  7. September 30th, 2018 at 20:50 | #7

    The problem however is always that sending paper birthday
    cards through send to friends and household who’re far could possibly be quite expensive and usually delayed.

    Feel free to start doing a web based search anytime the necessity for a
    no cost birthday greetings card arises.
    Share funny stories about the person that highlights what makes them
    special and well-loved.

  8. October 1st, 2018 at 04:36 | #8

    I was reading through some of your content on this internet site and I believe
    this web site is very instructive! Keep putting up.

  9. October 1st, 2018 at 10:49 | #9

    Hey nice post! I hope it’s ok that I shared it on my FB, if not, no worries just let me know and I’ll remove it.
    Regardless keep up the good work.

  10. October 3rd, 2018 at 16:10 | #10

    That is a really good tip particularly to those fresh
    to the blogosphere. Simple but very precise information… Thank you for sharing this one.
    A must read article!

  11. October 6th, 2018 at 15:36 | #11

    I’m gone to say to my little brother, that he should also pay a
    quick visit this blog on regular basis to get updated from latest news.

  12. October 12th, 2018 at 06:30 | #12

    That is really fascinating, You are an excessively professional blogger.
    I have joined your rss feed and sit up for searching for mkre of
    your magnificent post. Additionally, I have shared your site in my
    social networks

  13. October 13th, 2018 at 18:52 | #13

    I invite Larry, the sweetheart, to share the encounter from indulging in every
    great tasting scrap from my Red Plush Birthday cake.

  14. October 17th, 2018 at 13:36 | #14

    It’s wonderful that you are getting ideas from this piece
    of writing as well as from our discussion made at this time. http://www.substate.net/familienforum/member.php?action=profile&uid=39757

  15. October 18th, 2018 at 01:50 | #15

    This is the right webpage for anybody who would like to find out about this topic.

    You know so much its almost tough to argue with you (not that I personally would
    want to…HaHa). You definitely put a brand new
    spin on a subject that has been discussed for decades.
    Wonderful stuff, just wonderful!

  16. October 19th, 2018 at 05:32 | #16

    Pretty! This has been a really wonderful post.
    Thanks for providing this information. http://haikoukku.fi/index.php?action=profile;u=72345

  17. October 19th, 2018 at 23:07 | #17

    It’s remarkable in support of me to have a website, which is
    good designed for my knowledge. thanks admin

  18. October 20th, 2018 at 12:06 | #18

    Hi there it’s me, I am also visiting this website regularly, this web page is
    truly pleasant and the viewers are in fact sharing good thoughts. http://talkaboutendo.com/wp-content/plugins/zingiri-forum/mybb/member.php?action=profile&uid=56824

  19. October 20th, 2018 at 21:22 | #19

    Wow! After all I got a webpage from where I be capable of in fact obtain useful information concerning my study and knowledge. http://www.tongtongtong.com/www/userinfo.php?uid=3921987

  20. October 20th, 2018 at 22:57 | #20

    Thank you for every other informative web site. The place else could I get that kind
    of information written in such an ideal manner?
    I’ve a venture that I am simply now running on, and I have been on the glance out for such info. http://www.arealavoro.cloud/forum/index.php?action=profile;u=7056

  21. October 21st, 2018 at 13:48 | #21

    I am not really wonderful with English but I line up this rattling easygoing to translate.

  22. October 22nd, 2018 at 01:47 | #22

    It are the night club market When there is 1 industry that is booming during that downturn. The exact thing that has been true during The Great Depression holds true and this is that the money folks get the more that they start looking for techniques to escape
    their issues and a great night bar stipulates the right escape.
    They input a dream world at the place where they may
    ingest, mingle, and simply have a fantastic time without even fretting about their invoices and whether their own electricity
    is going to be shut off and are able to venture outside for
    a night on the town. This might sound sticking your head
    from the sand mindset, or immature; however, it’s human nature – even if merely to get a couple of
    hours, Learn More Here.

  23. October 22nd, 2018 at 20:38 | #23

    I know this web site gives quality depending content and other information, is there any other web page which offers such information in quality?

  24. October 24th, 2018 at 09:05 | #24

    I think that what you wrote made a lot of sense. However, consider this, suppose you composed a catchier title?
    I am not saying your information is not solid., but what if you
    added something that grabbed a person’s attention? I mean Flex 4: Changing the “displayAsPassword” default character |
    eonflex.com is a little vanilla. Youu should peek at Yahoo’s home page and note how thy create post
    headlines to get viewers to open the links.
    You might add a video or a related pic or twwo to get people nterested about
    what you’ve got to say. Just my opinion, it might bring your posts a little livelier.

  25. October 27th, 2018 at 00:00 | #25

    
    Que tal soy Morena y soy tu admiradora. Me fascinó tu columna Flex 4:
    Changing the “displayAsPassword” default character , pasé un buen momento leyendo.

    Únicamente quería declarar eso

  26. October 27th, 2018 at 03:52 | #26

    I am regular visitor, how are you everybody? This article posted at this site is
    genuinely nice.

  27. October 27th, 2018 at 11:11 | #27

    I do not even understand how I finished up here,
    however I assumed this post was great. I do not understand who you’re however definitely you are going to a
    well-known blogger for those who are not already.

    Cheers! https://www.solusipelunasutang.com/forum/index.php?action=profile;u=56286

  28. October 27th, 2018 at 14:40 | #28

    Creo que nunca antes lograría vivir con nadie que no le emocione irme de viaje
    al igual que yo.

  29. November 7th, 2018 at 15:14 | #29

    May I simply say what a relief to find someone that really understands what they are discussing online.
    You definitely know how to bring a problem to light
    and make it important. More and more people should read this and understand this
    side of the story. I can’t believe you are not more popular because you definitely
    possess the gift.

  30. November 10th, 2018 at 18:05 | #30

    FaceTime has always had video preview performance.

  31. November 11th, 2018 at 19:32 | #31

    I am no longer sure where you are getting your info, but great topic.
    I must spend some time learning much more or figuring out
    more. Thanks for fantastic information I was searching for this info for my mission.

  32. November 13th, 2018 at 13:43 | #32

    I blog frequently and I seriously appreciate your
    information. This article has truly peaked my interest.
    I will bookmark your site and keep checking for new details about once a week.

    I subscribed to your RSS feed as well.

  33. November 15th, 2018 at 22:44 | #33

    When someone writes an paragraph he/she retains the plan of a user in his/her brain that how a user can be aware of it. Thus that’s why this article is amazing. Thanks!

  34. November 19th, 2018 at 09:05 | #34

    Fine way of describing, and nice piece of writing to take information regarding my presentation focus, which i am going to present
    in university.

  35. November 20th, 2018 at 05:57 | #35

    We absolutely love your blog and find almost all of your post’s to be what precisely
    I’m looking for. Would you offer guest writers to
    write content available for you? I wouldn’t mind creating a post or elaborating on a
    number of the subjects you write related to here. Again, awesome blog!

  36. December 5th, 2018 at 10:16 | #36

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

  37. December 10th, 2018 at 22:43 | #37

    Oh my goodness! Amazing article dude! Thanks, However I am experiencing troubles with your RSS.
    I don’t understand the reason why I can’t join it. Is there anybody else getting identical RSS problems?

    Anyone who knows the answer will you kindly respond? Thanks!!

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