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

    My brother suggested I might like this website. He
    was entirely right. This post actually made my day.
    You can not imagine simply how much time I had spent for this information! Thanks!

  2. January 9th, 2025 at 14:56 | #2

    Pattaya Hotels In Thailand – How To Locate The Best 하이오피사이트

  3. January 9th, 2025 at 15:03 | #3

    Выбирайте тариф по потребностям, https://www.06236.com.ua/list/501126 в дальнейшем всегда доступно
    выбрать более дорогой тарифный план.

  4. January 9th, 2025 at 15:20 | #4

    WOW just what I was searching for. Came here by searching
    for visit our website

  5. January 9th, 2025 at 15:20 | #5

    If some one wishes expert view concerning blogging and site-building afterward i advise him/her to pay
    a quick visit this webpage, Keep up the pleasant work.

  6. January 9th, 2025 at 15:21 | #6

    Night Club 하이오피

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

    I savor, result in I found exactly what I used to be having a look for.
    You’ve ended my four day long hunt! God Bless you man. Have
    a great day. Bye

  8. January 9th, 2025 at 15:25 | #8

    So i am always endeavouring to at all times keep current in the latest
    medical related information and facts on the subject of gestation, given my personal gig for life is just as a massage for women therapist.
    In cooperating with this unique adult population, I realize there could be
    very little which any individual two folks share outside the simple fact that they are surely currently pregnant.
    But yet, massage for women, prenatal yoga and fitness, in addition to hiring a childbirth doula will most certainly be propositions that happen to be basically generally appropriate to obtain the best possible childbirth moment.

  9. January 9th, 2025 at 15:36 | #9

    Quality articles or reviews is the main to attract
    the viewers to pay a quick visit the web page, that’s what this web site is providing.

  10. January 9th, 2025 at 15:40 | #10

    Our painters received required skills, experience in https://contactout.com/company/Mantra-Bio-8259, as
    well as tools in order produce work promptly and quite reasonable to be afraid.

  11. January 9th, 2025 at 15:43 | #11

    Do you have any video of that? I’d care to find out more details.

  12. January 9th, 2025 at 15:49 | #12

    Owning A Bar On A Tropical Island – Could Possibly Really A Fantasy?
    op

  13. January 9th, 2025 at 15:50 | #13

    With arbitrary approaches in action, it’s alongside impossible
    to gauge their efficiency.

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

    Luxury1288

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

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

  16. January 9th, 2025 at 16:17 | #16

    This paragraph will assist the internet users for
    setting up new webpage or even a blog from start to
    end.

  17. January 9th, 2025 at 16:21 | #17

    This is really interesting, You’re a very skilled blogger.

    I have joined your feed and look forward to seeking more of your great
    post. Also, I have shared your website in my social networks!

  18. January 9th, 2025 at 16:22 | #18

    Appreciating the dedication you put into your blog
    and in depth information you offer. It’s awesome to
    come across a blog every once in a while that isn’t the same out of date rehashed
    material. Fantastic read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google
    account.

  19. January 9th, 2025 at 16:43 | #19

    This is a useful option, due to the fact that practically all available selenium test platforms
    rely python, which allows to conduct https://firm86.

  20. January 9th, 2025 at 16:46 | #20

    Full Service Spa OP

  21. January 9th, 2025 at 16:58 | #21

    I think this is one of the most vital info for me.
    And i’m glad reading your article. But should remark
    on some general things, The website style is ideal, the articles is really nice : D.

    Good job, cheers

  22. January 9th, 2025 at 17:00 | #22

    Do you have a spam problem on this website; I also am a
    blogger, and I was wanting to know your situation; we have created some nice practices and we are
    looking to trade solutions with other folks, be sure to shoot
    me an e-mail if interested.

  23. January 9th, 2025 at 17:04 | #23

    As a group, they have experience designing hundreds of upscale KBBQ restaurants in the U.S.
    and South Korea.

  24. January 9th, 2025 at 17:08 | #24

    I am really glad to glance at this blog posts which carries tons of valuable information, thanks for providing such information.

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

    Wow! In the end I got a website from where I be able to in fact obtain useful information concerning my study and knowledge.

  26. January 9th, 2025 at 17:23 | #26

    I love reading an article that can make people think. Also,
    thanks for permitting me to comment!

  27. January 9th, 2025 at 17:26 | #27

    Hey There. I found your blog using msn. This is a really well written article.
    I’ll be sure to bookmark it and come back to read more of your useful
    info. Thanks for the post. I’ll certainly return.

  28. January 9th, 2025 at 17:32 | #28

    When You Might Need Better Casino Winning Odds 에볼루션 카지노 리뷰

  29. January 9th, 2025 at 17:35 | #29

    How Can Voip Support Small Business Growth? 다바오머니상

  30. January 9th, 2025 at 17:37 | #30

    Hello, I enjoy reading through your post. I like to write a
    little comment to support you.

Comment pages
1 71 72 73 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