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. January 14th, 2025 at 15:46 | #1

    Güvenilir kick takipçi satın alma sitesi. Ziyaret Et kick takipçi satın al

  2. January 14th, 2025 at 15:51 | #2

    It’s awesome to go to see this web page and reading the
    views of all mates concerning this article, while I am
    also eager of getting knowledge.

  3. January 14th, 2025 at 15:56 | #3

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your
    point. You obviously know what youre talking about, why throw away
    your intelligence on just posting videos to your site
    when you could be giving us something informative to read?

  4. January 14th, 2025 at 16:04 | #4

    Wow, this paragraph is pleasant, my sister is analyzing such things, thus I am going to inform her.

  5. January 14th, 2025 at 16:23 | #5

    How Display Authority And Authenticity Inside Your Business 하이오피

  6. January 14th, 2025 at 16:25 | #6

    Forex Comparable A Casino – Playing Too Much Can Hurt 에볼루션 카지노 위치; https://evolutionkr.kr/,

  7. January 14th, 2025 at 16:34 | #7

    Great goods from you, man. I have understand your stuff
    previous to and you are just extremely fantastic.
    I actually like what you have acquired here, really like
    what you are saying and the way in which you say it.
    You make it enjoyable and you still take care of to keep it sensible.

    I can’t wait to read much more from you. This is really a wonderful web site.

  8. January 14th, 2025 at 16:35 | #8

    Howdy! This is my 1st 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 deal
    with the same subjects? Many thanks!

  9. January 14th, 2025 at 16:51 | #9

    I really like what you guys are usually up too.
    This kind of clever work and coverage! Keep up the superb works guys
    I’ve included you guys to blogroll.

  10. January 14th, 2025 at 17:06 | #10

    Your method of telling the whole thing in this
    piece of writing is really pleasant, every one can effortlessly understand it, Thanks a
    lot.

  11. January 14th, 2025 at 17:09 | #11

    I used to be able to find good information from your articles.

  12. January 14th, 2025 at 17:11 | #12

    I’m gone to tell my little brother, that he should also go
    to see this website on regular basis to obtain updated from hottest
    information.

  13. January 14th, 2025 at 17:11 | #13

    Full Service Spa HiOP

  14. January 14th, 2025 at 17:17 | #14

    Takipçi.Al ile sizde sosyal medya hesaplarınızı öne çıkartın! takipçi al

  15. January 14th, 2025 at 17:27 | #15

    This is very interesting, You’re a very skilled blogger.
    I have joined your rss feed and look forward to seeking more of your wonderful post.
    Also, I have shared your website in my social networks!

  16. January 14th, 2025 at 17:42 | #16

    I like the valuable information you provide in your articles.

    I will bookmark your blog and check again here frequently.
    I am quite sure I’ll learn a lot of new stuff right here!
    Good luck for the next!

  17. January 14th, 2025 at 17:52 | #17

    This is my first time visit at here and i am actually happy to
    read everthing at single place.

  18. January 14th, 2025 at 17:53 | #18

    Ѕpot on with tgis write-up, I seriously think this site needs a loot more attention. I’ll probably bе returning to read more, thanks for the informatіon!

  19. January 14th, 2025 at 17:59 | #19

    Hello i am kavin, its my first occasion to commenting anyplace,
    when i read this article i thought i could also make comment due
    to this brilliant piece of writing.

  20. January 14th, 2025 at 18:03 | #20

    Spot on with this write-up, I truly believe that this web site needs much more attention. I’ll probably
    be back again to read through more, thanks for the
    information!

  21. January 14th, 2025 at 18:07 | #21

    I was recommended this blog 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 amazing! Thanks!

  22. January 14th, 2025 at 18:15 | #22

    For the reason that the admin of this site is working, no
    doubt very rapidly it will be famous, due to its feature contents.

  23. January 14th, 2025 at 18:18 | #23

    Ahaa, its good dialogue concerning this article
    at this place at this blog, I have read all that, so at this time me
    also commenting here.

  24. January 14th, 2025 at 18:23 | #24

    Hmm is anyone else having problems with the pictures on this blog loading?
    I’m trying to figure out if its a problem on my end or if it’s the blog.

    Any responses would be greatly appreciated.

  25. January 14th, 2025 at 18:28 | #25

    Excellent goods from you, man. I have understand your stuff previous to and you are just too great.

    I really like what you’ve acquired here, really like what
    you are saying and the way in which you say it.
    You make it entertaining and you still take care of to
    keep it sensible. I can’t wait to read much more from you.
    This is actually a terrific site.

  26. January 14th, 2025 at 18:42 | #26

    Thank you for the good writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you!
    However, how can we communicate?

  27. January 14th, 2025 at 18:52 | #27

    Informative article, totally what I wanted to find.

  28. January 14th, 2025 at 18:53 | #28

    Aw, this was an exceptionally good post. Taking a few minutes and actual effort to produce a great article… but what
    can I say… I hesitate a whole lot and never manage to get nearly
    anything done.

  29. January 14th, 2025 at 19:05 | #29

    Whoa! This blog looks just like my old one!

    It’s on a totally different subject but it has pretty much the same page layout and design.
    Outstanding choice of colors!

  30. January 14th, 2025 at 19:30 | #30

    Keep on writing, great job!

  31. January 14th, 2025 at 20:27 | #31

    Thanks in favor of sharing such a pleasant opinion, article is fastidious,
    thats why i have read it fully

  32. January 14th, 2025 at 20:59 | #32

    Hello, i think that i saw you visited my website thus i came
    to “return the favor”.I am trying to find things to enhance my site!I suppose its
    ok to use some of your ideas!!

  33. January 14th, 2025 at 21:14 | #33

    Heya i’m for the primary time here. I found this board and I to find It really useful & it helped me
    out a lot. I am hoping to provide something back and aid others
    such as you helped me.

  34. January 14th, 2025 at 21:25 | #34

    Hello, for all time i used to check webpage posts here in the early hours in the dawn, for the
    reason that i love to gain knowledge of more and more.

  35. January 14th, 2025 at 21:55 | #35

    Hello, after reading this awesome piece of writing
    i am too happy to share my know-how here with colleagues.

  36. January 14th, 2025 at 22:01 | #36

    Hi this is kind of of off topic but I was wondering if
    blogs use WYSIWYG editors or if you have to manually code
    with HTML. I’m starting a blog soon but have no coding experience so I wanted
    to get guidance from someone with experience. Any help
    would be enormously appreciated!

  37. January 14th, 2025 at 22:20 | #37

    What’s up, after reading this amazing paragraph i
    am as well delighted to share my familiarity here with mates.

  38. January 14th, 2025 at 22:49 | #38

    Türkiyenin En Ucuz Sms Onay Sitesi -> sanal numara alma

  39. January 14th, 2025 at 23:09 | #39

    I truly love your site.. Great colors & theme. Did you build this
    site yourself? Please reply back as I’m wanting to create my very own blog and would like to know where you got this from or exactly what the theme is
    called. Thank you!

Comment pages
1 89 90 91 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
  14. October 19th, 2024 at 15:31 | #14
  15. October 22nd, 2024 at 18:24 | #15
  16. October 24th, 2024 at 04:17 | #16
  17. November 9th, 2024 at 10:01 | #17
  18. November 9th, 2024 at 11:51 | #18
  19. November 11th, 2024 at 04:18 | #19
  20. November 11th, 2024 at 06:33 | #20
  21. November 11th, 2024 at 07:08 | #21
  22. November 12th, 2024 at 02:12 | #22
  23. November 13th, 2024 at 08:00 | #23
  24. November 14th, 2024 at 06:12 | #24
  25. November 14th, 2024 at 14:35 | #25
  26. November 14th, 2024 at 16:23 | #26
  27. November 15th, 2024 at 05:09 | #27
  28. November 15th, 2024 at 05:46 | #28
  29. November 15th, 2024 at 11:13 | #29
  30. November 15th, 2024 at 11:46 | #30
  31. November 15th, 2024 at 19:12 | #31
  32. November 17th, 2024 at 04:29 | #32
  33. November 18th, 2024 at 05:00 | #33
  34. November 19th, 2024 at 12:11 | #34
  35. November 19th, 2024 at 19:46 | #35
  36. November 25th, 2024 at 21:09 | #36
  37. December 4th, 2024 at 00:57 | #37
  38. December 30th, 2024 at 18:41 | #38
  39. January 6th, 2025 at 21:21 | #39