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. July 1st, 2010 at 15:08 | #1

    Woot! That’s a lot easier.

    A colleague recently had to do this on a flex 3 project, and he ended up having to write a custom font.

    mx_internal FTW.

  2. Nathan
    October 11th, 2010 at 04:23 | #2

    It wont work if we modify some characters in between the text

  3. December 21st, 2013 at 06:49 | #3

    amassing amateurs amazedly ambaries amberies amberina amberoid ambiance.

    laveers  lavrock  lawbook  lawines  lawings  lawless  lawlike  lawsuit.
    stags    stagy    staid    staig    stain    stair    stake    stale.

  4. January 2nd, 2014 at 12:44 | #4

    Hi! This is my first comment here so I just wanted to give a quick shout out and say
    I really enjoy reading your posts. Can you suggest any other
    blogs/websites/forums that go over the same topics? Thanks!

  5. February 13th, 2014 at 23:24 | #5

    They dedicate their resources to come up with more stages to complete, and players can pause the
    game whenever and wherever you want. The game has the central character ‘Kratos’ being forced to return
    to the arcade after begging another dollar from mommy, or to simply get
    through the one choke point of the game. Star Wars: Shadows of the
    Empire1996 for the Nintendo DS hardware. Just call and ask if they are not considered clash of clans hack hack cheats.

  6. February 27th, 2014 at 01:08 | #6

    Marvelous, what a web site it is! This blog provides helpful facts to us,
    keep it up.

  7. February 28th, 2014 at 17:18 | #7

    Yes! Finally someone writes about battle camp hack.

  8. March 1st, 2014 at 13:56 | #8

    Hi are using WordPress for your site platform? I’m new to the blog world but I’m trying
    to get started and create my own. Do you require any html coding knowledge to
    make your own blog? Any help would be greatly
    appreciated!

  9. March 8th, 2014 at 15:09 | #9

    I am really impressed together with your writing skills as well as
    with the structuree for your blog. Is that this a
    paid subject matter or did you modify it yourself? Anyway stay up
    the nice high quality writing, it’s rare to peer a great blog like this one these days..

  10. March 11th, 2014 at 05:43 | #10

    Wonderful blog! I found it while searching on Yahoo News.
    Do you have any suggestions on how to get listed in Yahoo
    News? I’ve been trying for a while but I never seem to
    get there! Appreciate it

  11. March 11th, 2014 at 13:30 | #11

    Hey! I know this is somewhat off-topic however I had to ask.
    Does building a well-established website such as yours take
    a massive amount work? I’m completely new to operating
    a blog but I do write in my diary every day. I’d like to start a
    blog so I can share my personal experience and feelings
    online. Please let me know if you have any recommendations or tips for new aspiring bloggers.
    Thankyou!

  12. March 13th, 2014 at 23:15 | #12

    Hello to every , because I am actually keen of reading this weblog’s post to be updated daily.

    It contains fastidious data.

  13. March 14th, 2014 at 06:23 | #13

    There are people who believe that you simply do not have being married to get in a committed relationship.
    She is the founder of the author of Is He Cheating on You.
    Women that cheat do it for several reasons than men take action.

  14. March 14th, 2014 at 16:56 | #14

    Hi, Neat post. There is a problem along with your site in web explorer, may
    test this? IE still is the market leader and a good element of people will miss your magnificent
    writing due to thyis problem.

  15. March 14th, 2014 at 18:22 | #15

    Hello, every time i used to check blog posts here early in the dawn, since i love to gain knowledge of more and more.

  16. March 15th, 2014 at 21:17 | #16

    Hey! This post could not be written any better!
    Reading through this post reminds me of my previous room mate!
    He always kept chatting about this. I will forward this write-up to
    him. Pretty sure he will have a good read. Thanks for sharing!

  17. March 16th, 2014 at 01:09 | #17

    It’s appropriate time to make some plans for the longer term and it’s time
    to be happy. I have read this post and if I could I want
    to suggest you few interesting issues or suggestions.
    Perhaps you can write subsequent articles referring to this article.
    I want to read even more issues approximately it!

  18. March 17th, 2014 at 15:32 | #18

    endued   endues   endure   enduro   enemas   energy
      enface   enfold. zymotic  zymurgy  zyzzyva  aahing
    aaliis   aarrgh   abacas   abacus. hockeys  hocking  hocused  hocuses  hodaddy  hoddens  hoddins  hoecake.

  19. March 18th, 2014 at 17:27 | #19

    I have to thank you for the efforts you’ve put in writing this site.
    I am hoping to check out the same high-grade content from you later on as well.

    In fact, your creative writing abilities has inspired me to get my own
    blog now ;)

  20. March 19th, 2014 at 16:39 | #20

    More importantly, this construction is seen as the setting which high up in the Andes and is covered with
    sheer cliffs, huge mountains, along with
    narrow valleys. In prison, he was taken under the wing of an equally mysterious man
    named Tiano (Jean-Claude Van Damme), who teaches him in
    the ways of some martial arts discipline in
    their surprisingly spacious cell. West, there is a mall that is known as
    Dragon City.

  21. March 19th, 2014 at 19:45 | #21

    Awesome! Its actually remarkable post, I have got much clear idea about from
    this post.

  22. March 20th, 2014 at 03:18 | #22

    Hi there, I found your web site by means of Google while looking
    for a comparable topic, your site got here up, it seems to be good.
    I have bookmarked it in my google bookmarks.
    Hello there, simply became alert to your weblog thru Google, and located that it’s truly informative.
    I’m going to watch out for brussels. I’ll be grateful if you happen to continue this in future.
    A lot of people might be benefited from your writing.
    Cheers!

  23. March 20th, 2014 at 11:29 | #23

    Houser was born in London and always had a fascination for American crime – or the
    gangster pop culture of movies like “The Godfather”, “Scarface” and “Carlito’s Way”.
    Imagine that you are almost away from the police, but your car somehow gets damaged and a couple of tires pop.

    Wooden doors should be able to shred under shotgun fire.

  24. March 21st, 2014 at 17:50 | #24

    whoah this blog is magnificent i love studying your posts.
    Keep up the great work! You recognize, lots of individuals are hunting around for
    this info, you can help them greatly.

  25. March 21st, 2014 at 18:29 | #25

    Thank you for the auspicious writeup. It in truth used
    to be a entertainment account it. Glance complex to more delivered agreeable from you!
    By the way, how could we be in contact?

  26. March 21st, 2014 at 18:55 | #26

    Magnificent beat ! I would like to apprentice while you amend your site, how can i subscribe for a blog site?

    The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear concept

  27. March 21st, 2014 at 20:52 | #27

    I enjoy what you guys tend to be up too. This kind of clever work and exposure!
    Keep up the very good works guys I’ve included you guys
    to our blogroll.

  28. March 22nd, 2014 at 02:37 | #28

    My relatives always say that I am killing my time here at web, but
    I know I am getting familiarity all the time by reading thes fastidious posts.

  29. March 22nd, 2014 at 03:21 | #29

    Heroo Zero Hack v1.7
    Download link: http://bit.ly/1l3DwdZ

    Instructions:
    1. Download and install.
    2. Connect the device using USB cable.
    3. Select the platform (iOS/Android) and cljck on “Apply cheats” button.

    4. Play the game.

  30. March 22nd, 2014 at 07:41 | #30

    With every thing that seems to be developing throuughout this specific
    subjectt matter, all your points of view are
    fairly exciting. Having saod that, I appologize, because I do not subscribe to your whole suggestion, all be it
    radical none the less. It seems to everyone that your
    opinions are not completely validated and in reality you are yourzelf not entirely confident of your point.
    In any event I did take pleasure in reading it.
    I do love tthe way yoou have presented this particular

  31. March 22nd, 2014 at 11:23 | #31

    Hi there to all, how is all, I think every one is getting more from this web page, and your views are fastidious designed for new viewers.

  32. March 22nd, 2014 at 12:49 | #32

    Yesterday, while I was at work, my cousin stole
    my iphone and tested to see if it can survive a 40 foot drop, just so sshe
    can be a youtube sensation. My iPadd is now broken and shhe has 83 views.

    I know this is entirely off topic but I had to share it with someone!

  33. March 22nd, 2014 at 15:59 | #33

    Everyone loves it when individuals get together and
    share thoughts. Great website, continue the good work!

  34. March 22nd, 2014 at 18:01 | #34

    Great info. Lucky me I discovered your site by accident (stumbleupon).
    I’ve book marked it for later!

  35. March 22nd, 2014 at 20:27 | #35

    Heya! I just wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no data backup.
    Do you have any solutions to prevent hackers?

  36. March 23rd, 2014 at 02:55 | #36

    If you want to get the best cleaning services then you’d better choose one in
    Glen Village. Commercial building structures are subject
    to the ravages of weather elements just like any other structure.
    There are several processes and methods involved in the cleaning procedure of your valuable flooring carpets.

  37. March 23rd, 2014 at 05:51 | #37

    Hello to every one, as I am in fact keen of reading this web
    site’s post to be updated regularly. It includes fastidious information.

  38. March 23rd, 2014 at 05:53 | #38

    beats by dr dre solo
    Hello! I’ve been reading your weblog for a long time now and finally got the bravery to go ahead and give you a shout out from New
    Caney Texas! Just wanted to mention keep up the fantastic job!

  39. March 23rd, 2014 at 06:18 | #39

    These are truly impressive ideas in concerning blogging.

    You have touched some fastidious factors here. Any way keep up wrinting.

  40. March 24th, 2014 at 00:02 | #40

    Howdy great blog! Does running a blog similar to this take a massive
    amount work? I’ve virtually no knowledge of programming however I
    was hoping to start my own blog soon. Anyhow,
    if you have any suggestions or tips for new blog
    owners please share. I know this is off subject however I just had to ask.
    Cheers!

  41. March 24th, 2014 at 01:39 | #41

    This is the right web site for everyone who really wants to find
    out about this topic. You know a whole lot its almost hard to argue with you (not that I really will need to

  42. March 25th, 2014 at 02:16 | #42

    You have made some really good points there. I looked on the web to find
    out more about the issue and found most people will
    go along with your views on this website.

  43. March 25th, 2014 at 10:00 | #43

    The reason is – video-on-demand market is the only model that works on subscriptions.
    ANTENNA: I get the same number of channels over the air as
    I did when I had a 7 year old generic HD TV. This is useful if your TV is connected to an audio system, as you can browse your i – Pod library and select
    songs wirelessly from the handheld device.

  44. March 25th, 2014 at 11:26 | #44

    Just wish to say your article is as astonishing. The clearness in your post is
    just spectacular and i could suppose you’re knowledgeable in this subject.

    Fine with your permission let me to grasp your feed to keep
    updated with drawing close post. Thanks one million
    and please carry on the rewarding work.

  45. March 25th, 2014 at 13:18 | #45

    In fact, you have your choice of clothing designed as activewear or activewear designs incorporated into designer fashion.
    Reformation’s Head Designer, Brianna Lance, will be custom fitting vintage Levi’s to fit your body.
    It does not suggest that IPods are the finest means to hear to songs but it is most common ways to be in style.

  46. March 26th, 2014 at 00:03 | #46

    I believe everything typed was actually very reasonable.
    But, what about this? what if you were to create a awesome
    post title? I am not suggesting your content isn’t solid,
    however what if you added something to possibly grab people’s attention?
    I mean Flex 4: Changing the

  47. March 26th, 2014 at 01:32 | #47

    I’m not sure exactly why but this website iis loading incredibly
    slkow for me. Is anyone else having this problm orr is it a
    problem onn my end? I’ll check back later on and see if the problem still
    exists.

  48. March 26th, 2014 at 06:08 | #48

    Hi my loved one! I wish to say that this article is awesome,
    nice written and come with approximately all important infos.
    I’d like to look more posts like this .

  49. March 26th, 2014 at 08:17 | #49

    Founder & CEO of Food+Tech Connect, she’s an individual GPS for food professionals,
    tech and design savants, and food and farm entrepreneurs.
    Pedro recognized Adam immediately from his association with
    Jimmy Kimmel, but then he went onto explain that he’s got
    another show. Settings >Developer Options >Select Run time >Use ART.

  50. March 26th, 2014 at 16:26 | #50

    Everyoe loves what you guys are up too. Such clever ork and reporting!
    Keep up the wonderful works guys I’ve incorporated you guys to ouur blogroll.

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