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 26th, 2014 at 16:40 | #1

    I love your blog.. very nice colors & theme. Did you create this website yourself or did you hire
    someone to do it for you? Plz respond as I’m looking to
    design my own blog and would like to know where u got this
    from. thanks a lot

  2. March 26th, 2014 at 19:42 | #2

    Good post but I was wondering if you could write a litte
    more on this topic? I’d be very thankful if you could elaborate a little bit more.
    Kudos!

  3. March 26th, 2014 at 23:44 | #3

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

  4. March 27th, 2014 at 05:43 | #4

    Heya! I know this is somewhat off-topic but I needed to ask.
    Does running a well-established blog such as yours
    take a massive amount work? I am completely new to
    running a blog however I do write in my diary everyday.
    I’d like to start a blog so I will be able to share my personal experience and thoughts online.
    Please let me know if you have any suggestions or tips for brand new aspiring blog owners.
    Appreciate it!

  5. March 27th, 2014 at 07:00 | #5

    I understand that the viewing angle has also been decreased slightly, but this wasn’t really apparent — the Canon T2i’s display continues to be very easily visible from a wide variety
    of angles, fantastic for everyone to huddle all around and examine group portraits.
    Similar to other digital cameras, the megapixels offered should
    also be considered as the number of megapixels is directly proportional to the sharpness of the image.
    You can even pre-capture a couple seconds of video before you
    press the shutter.

  6. March 27th, 2014 at 13:04 | #6

    Hi there Dear, are you actually visiting this web site daily,
    if so then you will without doubt get nice knowledge.

  7. March 27th, 2014 at 15:38 | #7

    Hey would you mind stating which blog platform you’re working with?
    I’m going to start my own blog soon but I’m having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking for something
    completely unique. P.S Sorry for being off-topic but I had to ask!

  8. March 27th, 2014 at 19:54 | #8

    Ms Rowe does not plan to do landlord insurance this, however
    a landlord may charge more is if a tenant has paid for the guarantee of steady rental payments.
    Yasmin Alibhai Brown criticises Stephen Fry for his
    comments on women and sex Opinion, 1 November. Hubrecht’s frustration with someone he saw as a troublesome tenant who had ignored
    a variety of reasons, not least of which is targeting contractors seeking temporary staff accommodation.

  9. March 28th, 2014 at 00:31 | #9

    An interesting discussion is worth comment. I think that you ought to publish more
    about this subject matter, it might not be a taboo subject but generally people do not speak about
    such subjects. To the next! Cheers!!

  10. March 28th, 2014 at 19:13 | #10

    What’s up to all, how is all, I think every one is getting more from this web site, and your views are fastidious
    designed for new visitors.

  11. March 28th, 2014 at 23:57 | #11

    Hi there Dear, are you actually visiting this
    website daily, if so after that you will absolutely obtain
    good experience.

  12. March 29th, 2014 at 08:02 | #12

    I know this web site offers quality depending posts and extra stuff, is
    there any other web site which gives these kinds of things in quality?

  13. March 30th, 2014 at 06:37 | #13

    I am curious to find out what blog system you’re utilizing?
    I’m having some minor security problems with my latest site and I’d like to find something more safe.

    Do you have any recommendations?

  14. March 30th, 2014 at 07:03 | #14

    Good day! Do you use Twitter? I’d like to follow you
    if that would be okay. I’m definitely enjoying your blog and look
    forward to new posts.

  15. March 30th, 2014 at 09:30 | #15

    A person essentially lend a hand to make seriously posts I’d state.
    This is the very first time I frequented your website page
    and to this point? I surprised with the research
    you made to create this actual submit amazing. Fantastic activity!

  16. March 30th, 2014 at 17:19 | #16

    Your mode of explaining all in this paragraph is in fact nice,
    every one be able to easily know it, Thanks a lot.

  17. March 30th, 2014 at 21:21 | #17

    You can definitely see your skills in the work you write.
    The sector hopes for more passionate writers such as you who are not afraid to say how they believe.
    At all times go after your heart.

  18. March 31st, 2014 at 10:05 | #18

    Hey there just wanted to give you a quick heads up.

    The text in your article seem to be running off the
    screen in Chrome. I’m not sure if this is a formatting issue or
    something to do with internet browser compatibility but I thought I’d post
    to let you know. The layout look great though! Hope you get the problem solved soon.
    Thanks

  19. April 8th, 2014 at 05:49 | #19

    Way cool! Some extremely valid points! I appreciate you writing this write-up plus the rest of the website is
    really good.

  20. April 8th, 2014 at 09:35 | #20

    Usually I don’t learn post on blogs, but I
    wish to say that this write-up very forced me to try and
    do it! Your writing taste has been surprised me. Thanks, very nice article.

  21. April 10th, 2014 at 04:41 | #21

    Had been in actual fact shopping for just a normal shower enclosures during which I uncovered this
    site, didn’t have any idea there was such a thing as a ‘steam shower enclosure’, wow, may just
    may have to have one

  22. April 10th, 2014 at 08:22 | #22

    chanel Bags Canada
    This is a topic which is near to my heart… Cheers! Where are your contact
    details though?

  23. April 10th, 2014 at 10:42 | #23

    Surround sound from my PC both using an Asus Sabertooth 990FX motherboard and the slightly
    better Auzentech X-Forte sound card really makes my gaming experience
    a pleasure. There are motorcycle chases, fights in bars and even Yu Suzuki’s classic arcade games Space Harrier
    and Hang-On, both fully playable within the game’s virtual arcades.
    The Vega has good craftsmanship, without the faults of the imports.

  24. April 10th, 2014 at 16:19 | #24

    Not only that, but as I already talked about earlier, it’s going
    to also do an unbelievable job of video capture in those situations too,
    which is a really awesome feature. One of the greatest factors about this particular camera isn’t that it includes a stabilization lens or that it’s 14.
    The D7000 is an evolution of all that is good about Nikon right now.

  25. April 10th, 2014 at 18:28 | #25

    chanel Handbags Brazil
    I’m really impressed with your writing skills and also with the layout on your weblog.
    Is this a paid theme or did you modify it yourself?
    Either way keep up the nice quality writing, it’s rare
    to see a nice blog like this one nowadays.

  26. April 10th, 2014 at 19:34 | #26

    An amateur sleuth won’t even beau know where to turn.
    If you are in Central Park and take in the actual sights as well as their outcome.
    This type of background is not necessary, because the park is
    also open from April to October to make your life easier when defending a drunk driving case.

  27. April 10th, 2014 at 22:45 | #27

    Indonesia chanel Bags
    Thank you for the auspicious writeup. It in fact was a amusement account it.
    Look advanced to more added agreeable from you! However, how can we
    communicate?

  28. April 10th, 2014 at 23:57 | #28

    Attractive section of content. I just stumbled upon your web site and in accession capital to
    assert that I acquire in fact enjoyed account your blog posts.
    Anyway I’ll be subscribing to your feeds and even I achievement you access
    consistently fast.

  29. April 11th, 2014 at 14:49 | #29

    Aw, this was a very nice post. Taking the time and actual effort to produce a great article… but what can I say… I put things off a lot and never seem to get anything done.

  30. April 11th, 2014 at 21:40 | #30

    Greetings from Los angeles! I’m bored at work so
    I decided to check out your website on my iphone during lunch break.
    I really like the info you provide here and can’t wait to take a look when I get home.
    I’m surprised at how quick your blog loaded on my
    phone .. I’m not even using WIFI, just 3G .. Anyways, excellent blog!

  31. April 12th, 2014 at 21:15 | #31

    Garcinia Cambogia a simple fruit and vegetables, are nutritionally deficient
    due to over eating. With 90 calories per 8 ounces, finishing an entire can adds up
    to pounds lost over time. Incorporating this component to meals is considered
    to be specially valuable for people with insulin resistance or diabetes, these powerful inner motivations are
    difficult to permanently maintain. Dr Mehmet
    Oz and his staff should do a bit more time.

  32. April 14th, 2014 at 08:20 | #32

    Ryan Henderson created this product and he has over twenty years of woodworking experience
    in building wood sheds. So with some proper planning and coordinated execution, even a complicated project can be made easier by setting up your machines once and doing all similar parts at the same time.
    This is a great way to find mats and sell them or use
    them to make the items that you need either from food or
    from woodworking.

  33. April 15th, 2014 at 16:28 | #33

    My spouse and I stumbled over here coming from a different page and
    thought I might as well check things out. I like what I
    see so now i am following you. Look forward to checking out your web
    page yet again.

  34. April 17th, 2014 at 23:09 | #34

    chanel Bag South Korea
    I’ll right away grab your rss as I can’t in finding your email subscription link or e-newsletter service.
    Do you have any? Kindly permit me understand so that I could subscribe.

    Thanks.

  35. April 18th, 2014 at 00:28 | #35

    I enjoy what you guys tend to be up too. This type of clever work and exposure!
    Keep up the excellent works guys I’ve incorporated you guys to my blogroll.

  36. April 18th, 2014 at 06:17 | #36

    chanel handbag collection
    bookmarked!!, I love your site!

  37. April 18th, 2014 at 11:11 | #37

    I know this if off topic but I’m looking into starting
    my own blog and was curious what all is required to get setup?
    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

  38. April 18th, 2014 at 18:40 | #38

    I have been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my view, if all website owners and
    bloggers made good content as you did, the internet will be much more useful than ever before.

  39. April 19th, 2014 at 17:02 | #39

    Hello,i think that i saw you visited my weblog thus i came to “return the favor”.I
    am attempting to find things to improve my site!I suppose its ok to use
    a few of your ideas!!

  40. April 19th, 2014 at 18:10 | #40

    I am extremely impressed with your writing skills as well as with the layout on your
    weblog. Is this a paid theme or did you modify it yourself?

    Either way keep up the excellent quality writing, it’s rare to see a great blog like this one today.

  41. April 20th, 2014 at 16:55 | #41

    Hello to every single one, it’s actually a good for me to visit this
    web page, it includes helpful Information.

  42. April 21st, 2014 at 14:46 | #42

    Good day! I know this is kinda off topic but I was wondering which blog platform are you using for this website?
    I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform.
    I would be awesome if you could point me in the direction of a good platform.

  43. April 22nd, 2014 at 08:43 | #43

    Hi to all, since I am in fact keen of reading this web site’s post to be updated daily.

    It consists of pleasant information.

  44. April 22nd, 2014 at 11:29 | #44

    I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed
    about my trouble. You are wonderful! Thanks!

  45. April 22nd, 2014 at 23:52 | #45

    Amazing! Its genuinely amazing post, I have got much clear idea regarding
    from this post.

  46. April 23rd, 2014 at 16:43 | #46

    The key to a comfy college dorm or living space is making effective use of what little space
    you have. It can contain toxins and should not be breathed in.
    Tigerwood flooring displays a level of shade change with a noticeable darkening of
    the qualifications under the lines from a mild orangey
    tan to an in-depth reddish shaded darkish shade,
    which then in turn makes the striping less distinct and more simple.

  47. April 24th, 2014 at 08:45 | #47

    You made some decent points there. I checked on the net for more info about the issue and found most
    individuals will go along with your views on this
    website.

  48. April 24th, 2014 at 11:03 | #48

    Hi there every one, here every person is sharing these knowledge, therefore it’s pleasant to read this
    webpage, and I used to pay a visit this weblog daily.

  49. April 24th, 2014 at 15:41 | #49

    We’re a group of volunteers and opening a brand new scheme in our community.
    Your site offered us with useful information to work on.

    You’ve done a formidable job and our entire group will likely be
    grateful to you.

  50. April 26th, 2014 at 00:18 | #50

    hi!,I really like your writing very much! percentage we communicate
    more approximately your article on AOL? I need a specialist in this
    house to resolve my problem. Maybe that’s you! Having a
    look forward to peer you.

Comment pages
1 2 3 4 17 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