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 16th, 2025 at 15:10 | #1

    whoah this blog is excellent i really like studying your posts.
    Keep up the good work! You know, lots of people are looking around for this information, you could
    aid them greatly.

  2. January 16th, 2025 at 15:15 | #2

    I don’t even know the way I ended up here, but I assumed this publish used to be good.
    I do not recognise who you are but definitely you’re going to a famous
    blogger for those who are not already. Cheers!

  3. January 16th, 2025 at 15:17 | #3

    Hey there would you mind sharing which blog platform you’re
    using? I’m looking to start my own blog in the near future but I’m having
    a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.
    P.S Apologies for getting off-topic but I had to ask!

  4. January 16th, 2025 at 15:17 | #4

    Hi! I could have sworn I’ve been to this blog before
    but after browsing through many of the articles I realized it’s
    new to me. Anyways, I’m certainly pleased I came across it and
    I’ll be bookmarking it and checking back often!

  5. January 16th, 2025 at 15:19 | #5

    Ahaa, its good conversation on the topic of this post here at this webpage, I have read
    all that, so at this time me also commenting at this place.

  6. January 16th, 2025 at 15:22 | #6

    Hello, yeah this post is actually nice and I have learned lot of things from it on the
    topic of blogging. thanks.

  7. January 16th, 2025 at 15:24 | #7

    Be where you can do your best work,​ begin your purpose,
     belong to an amazing global​ team, and become the best version of you.

  8. January 16th, 2025 at 15:27 | #8

    Explore The Highlights Of Denver Nightlife HiOP

  9. January 16th, 2025 at 15:28 | #9

    Fantastic site. Plenty of useful info here.
    I am sending it to several buddies ans additionally sharing in delicious.
    And of course, thank you to your effort!

  10. January 16th, 2025 at 15:29 | #10

    I’m excited to find this website. I want to to thank you for your time for this wonderful read!!
    I definitely appreciated every part of it and I have you book marked to see new information in your blog.

  11. January 16th, 2025 at 15:30 | #11

    Likewise, the further development of various forms of activity helps to improve the quality of innovative process management methods. And some features of domestic policy illuminate extremely interesting features of the picture as a whole, but specific conclusions, of course, are verified in a timely manner.

  12. January 16th, 2025 at 15:32 | #12

    Nice blog here! Also your website loads up very
    fast! What host are you using? Can I get your affiliate link to your host?
    I wish my website loaded up as quickly as yours lol

  13. January 16th, 2025 at 15:35 | #13

    Wonderful goods from you, man. I have understand your stuff previous to and you are just extremely magnificent.

    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 care for to keep it wise.
    I can not wait to read much more from you. This is actually a tremendous web site.

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

    Whiskey Bar 하이오피주소

  15. January 16th, 2025 at 15:38 | #15

    Gentlemen’s Club 하이오피

  16. January 16th, 2025 at 15:40 | #16

    A fantastic post on Flex 4: Changing the “displayAsPassword” default character |
    eonflex.com! The thoughts you shared about apps were highly appreciated.
    It’s clear that a lot of time went into this. Excited to explore more of your work.
    Keep up the good work!

  17. January 16th, 2025 at 15:44 | #17

    What a data of un-ambiguity and preserveness of valuable familiarity regarding unpredicted emotions.

  18. January 16th, 2025 at 15:49 | #18

    Thanks for the marvelous posting! I definitely enjoyed reading it,
    you will be a great author. I will ensure that I bookmark your blog and will come back in the
    foreseeable future. I want to encourage yourself to continue your great writing, have a nice evening!

  19. January 16th, 2025 at 15:51 | #19

    What i do not realize is in reality how you are not actually much more neatly-preferred
    than you may be now. You are so intelligent.
    You know thus significantly relating to this matter, made me for my part believe it from a lot of various angles.
    Its like men and women don’t seem to be involved until
    it is something to do with Lady gaga! Your own stuffs outstanding.
    At all times deal with it up!

  20. January 16th, 2025 at 15:57 | #20

    I for all time emailed this weblog post page to all my friends, for the reason that if like to read it afterward my contacts will too.

  21. January 16th, 2025 at 16:01 | #21

    It’s actually a cool and helpful piece of information. I am satisfied that you shared this useful information with us.

    Please keep us up to date like this. Thank you for sharing.

  22. January 16th, 2025 at 16:02 | #22

    Signature Drinks 부달사이트

  23. January 16th, 2025 at 16:04 | #23

    I am really impressed along with your writing talents as
    smartly as with the structure to your weblog. Is that
    this a paid topic or did you modify it your self?
    Either way stay up the nice quality writing, it is rare to peer a great blog like this one these
    days..

  24. January 16th, 2025 at 16:06 | #24

    Cocktail Lounge 부달최신주소

  25. January 16th, 2025 at 16:08 | #25

    I’m not sure where you are getting your info, but great
    topic. I needs to spend some time learning more or understanding more.
    Thanks for wonderful info I was looking for this information for my mission.

Comment pages
1 97 98 99 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