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

    With havin so much content and articles do you ever run into
    any issues of plagorism or copyright infringement? My site has a lot
    of unique content I’ve either written myself or outsourced but it appears a lot of it is popping it up all over the internet without my
    authorization. Do you know any methods to help prevent content from
    being stolen? I’d definitely appreciate it.

  2. January 30th, 2025 at 14:49 | #2

    Great blog! Is your theme custom made or did you
    download it from somewhere? A design like yours with a few simple adjustements would really make my blog stand out.
    Please let me know where you got your theme. Appreciate it

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

    This website certainly has all the information I wanted concerning this
    subject and didn’t know who to ask.

  4. January 30th, 2025 at 15:05 | #4

    Hi, this weekend is nice designed for me, because this moment i am reading
    this great educational paragraph here at my house.

  5. January 30th, 2025 at 15:08 | #5

    I was wondering if you ever thought of changing the
    page layout of your blog? Its very well written; I love
    what youve got to say. But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or 2 images.
    Maybe you could space it out better?

  6. January 30th, 2025 at 15:15 | #6

    great points altogether, you just received a emblem new reader.

    What may you recommend in regards to your submit
    that you made some days in the past? Any certain?

  7. January 30th, 2025 at 15:23 | #7

    excellent issues altogether, you simply gained a brand new reader.

    What could you recommend in regards to your post that you just made some days
    ago? Any positive?

  8. January 30th, 2025 at 15:28 | #8

    I am sure this post has touched all the internet users, its really really good post on building up new weblog.

  9. January 30th, 2025 at 15:35 | #9

    Hey there would you mind letting me know which web host you’re utilizing?
    I’ve loaded your blog in 3 different web browsers and I
    must say this blog loads a lot faster then most. Can you suggest a good hosting provider
    at a fair price? Thanks a lot, I appreciate it!

  10. January 30th, 2025 at 15:35 | #10

    Pretty section of content. I just stumbled upon your
    weblog and in accession capital to assert that I acquire in fact enjoyed account your blog
    posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently quickly.

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

    Awesome blog! Do you have any tips for aspiring writers? I’m planning to start my own website soon but I’m
    a little lost on everything. Would you advise starting with a free platform like WordPress or go for a paid option? There are so
    many choices out there that I’m totally confused ..
    Any suggestions? Many thanks!

  12. January 30th, 2025 at 15:56 | #12

    It is in reality a nice and useful piece of information. I am glad
    that you just shared this helpful info with us. Please stay us up to date like this.
    Thank you for sharing.

  13. January 30th, 2025 at 15:56 | #13

    After I initially commented I seem to have clicked the -Notify me when new comments are added-
    checkbox and now whenever a comment is added I recieve four
    emails with the exact same comment. Perhaps there is a means you can remove me from that service?
    Thanks!

  14. January 30th, 2025 at 16:01 | #14

    My brother suggested I would possibly like this website.
    He was totally right. This publish actually made my
    day. You can not believe just how a lot time I had spent for this info!
    Thanks!

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

    Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between superb usability and appearance.
    I must say you have done a superb job with this.
    In addition, the blog loads extremely fast for me on Chrome.
    Superb Blog!

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

    Good day! I could have sworn I’ve been to this blog before
    but after browsing through some of the post I realized it’s new to me.
    Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

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

    Excellent post. I used to be checking continuously this weblog and I’m inspired!
    Very useful information specially the closing section :)
    I maintain such information much. I was looking for this particular info for a very long
    time. Thank you and best of luck.

  18. January 30th, 2025 at 16:13 | #18

    Great post. I was checking constantly this blog and I am impressed!
    Very helpful information particularly the last part :) I care for such info a lot.

    I was seeking this certain information for a very long time.

    Thank you and best of luck.

  19. January 30th, 2025 at 16:17 | #19

    Whats up very nice blog!! Man .. Beautiful ..

    Amazing .. I’ll bookmark your site and take the feeds additionally?

    I’m glad to seek out a lot of useful information right here in the publish, we’d like work
    out extra strategies on this regard, thanks for sharing.
    . . . . .

  20. January 30th, 2025 at 16:29 | #20

    Spot on with this write-up, I honestly think this site needs much more
    attention. I’ll probably be returning to read more, thanks for the
    advice!

  21. January 30th, 2025 at 16:38 | #21

    Great article.

  22. January 30th, 2025 at 16:43 | #22

    Nicely put. With thanks!

  23. January 30th, 2025 at 16:43 | #23

    bokep terbaik sma toket gede menyala banget

  24. January 30th, 2025 at 16:44 | #24

    Easy going and with a lovely personality, Sandra is fully qualified to teach in both manual and automatic cars.

  25. January 30th, 2025 at 16:48 | #25

    Gary also teaches in medium and heavy goods trucks along with a car and a trailer.

  26. January 30th, 2025 at 16:54 | #26

    I feel my pupils are in capable hands when they call my office.

  27. January 30th, 2025 at 16:57 | #27

    Whats up 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 need any html coding expertise to make your own blog?
    Any help would be greatly appreciated!

  28. January 30th, 2025 at 17:12 | #28

    Hi I am so glad I found your site, I really found you by error,
    while I was looking on Google for something else, Anyways
    I am here now and would just like to say many thanks for a remarkable post and a all round thrilling blog (I also love the theme/design), I don’t have time to read it all at the
    moment but I have saved it and also included your RSS feeds, so when I have
    time I will be back to read a lot more, Please do keep up
    the great job.

  29. January 30th, 2025 at 17:18 | #29

    I do not even know how I finished up here, however I thought this publish was once good.
    I don’t realize who you are but definitely you’re going to a famous blogger when you aren’t already.
    Cheers!

  30. January 30th, 2025 at 17:23 | #30

    I think this is one of the most important info for me.

    And i am glad reading your article. But want to remark on some general things, The website style is ideal, the articles is really great :
    D. Good job, cheers

  31. January 30th, 2025 at 17:23 | #31

    Hi, after reading this awesome piece of writing i am too cheerful to share my knowledge here with mates.

  32. January 30th, 2025 at 17:25 | #32

    Hi! I’ve been following your site for a while now and finally got
    the courage to go ahead and give you a shout out from Huffman Texas!
    Just wanted to say keep up the excellent work!

  33. January 30th, 2025 at 17:31 | #33

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

  34. January 30th, 2025 at 17:33 | #34

    Hi there, just wanted to mention, I loved this article.
    It was helpful. Keep on posting!

Comment pages
1 152 153 154 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
  40. January 21st, 2025 at 19:12 | #40
  41. January 21st, 2025 at 19:27 | #41
  42. January 21st, 2025 at 21:18 | #42
  43. January 21st, 2025 at 21:20 | #43
  44. January 21st, 2025 at 21:34 | #44
  45. January 21st, 2025 at 22:46 | #45
  46. January 21st, 2025 at 23:10 | #46
  47. January 21st, 2025 at 23:38 | #47
  48. January 22nd, 2025 at 01:51 | #48
  49. January 22nd, 2025 at 03:06 | #49
  50. January 22nd, 2025 at 03:11 | #50
  51. January 22nd, 2025 at 05:36 | #51
  52. January 22nd, 2025 at 07:18 | #52
  53. January 22nd, 2025 at 08:20 | #53
  54. January 22nd, 2025 at 08:48 | #54
  55. January 22nd, 2025 at 08:49 | #55
  56. January 22nd, 2025 at 08:54 | #56
  57. January 22nd, 2025 at 09:01 | #57
  58. January 22nd, 2025 at 09:06 | #58
  59. January 22nd, 2025 at 09:45 | #59
  60. January 22nd, 2025 at 09:59 | #60
  61. January 22nd, 2025 at 10:50 | #61
  62. January 22nd, 2025 at 11:00 | #62
  63. January 22nd, 2025 at 11:35 | #63
  64. January 22nd, 2025 at 14:26 | #64
  65. January 22nd, 2025 at 15:11 | #65
  66. January 22nd, 2025 at 15:29 | #66