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

    When someone writes an piece of writing he/she retains the thought of
    a user in his/her mind that how a user can be aware of it.
    Thus that’s why this paragraph is outstdanding. Thanks!

  2. January 10th, 2025 at 00:32 | #2

    You need to be a part of a contest for one of the most useful websites on the internet.

    I will recommend this site!

  3. January 10th, 2025 at 00:35 | #3

    Hi it’s me, I am also visiting this website regularly, this web page
    is really fastidious and the viewers are genuinely sharing
    good thoughts.

  4. January 10th, 2025 at 00:41 | #4

    I know this site offers quality based articles and
    extra material, is there any other site which gives such
    stuff in quality?

  5. January 10th, 2025 at 00:47 | #5

    I was recommended this blog by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my difficulty.
    You are wonderful! Thanks!

  6. January 10th, 2025 at 00:48 | #6

    Cocktail Bar 밤문화

  7. January 10th, 2025 at 00:51 | #7

    Pretty nice post. I just stumbled upon your blog and wanted tto say that I have truly enjoyed
    browsing your blog posts. After all I’ll be subscribing to your rss fed and I hope you write
    again soon!

  8. January 10th, 2025 at 01:03 | #8

    Hi to every , for the reason that I am in fact eager of reading this web site’s post to be updated regularly.

    It carries good data.

  9. January 10th, 2025 at 01:04 | #9

    Excellent article. I will be experiencing many of these issues as well..

  10. January 10th, 2025 at 01:11 | #10

    Hi! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Many thanks!

  11. January 10th, 2025 at 01:15 | #11

    I’m truly enjoying the design and layout
    of your site. It’s a very easy on the eyes
    which makes it much more enjoyable for me to come here and
    visit more often. Did you hire out a developer to create your theme?
    Superb work!

  12. January 10th, 2025 at 01:15 | #12

    Very rapidly this website will be famous amid all blog visitors, due to it’s nice articles

  13. January 10th, 2025 at 01:28 | #13

    Thanks in favor of sharing such a pleasant thinking, post is good, thats why i have read it entirely

  14. January 10th, 2025 at 01:31 | #14

    I think this is among the most significant
    info for me. And i’m satisfied studying your article.
    However should observation on some basic issues, The website taste
    is perfect, the articles is really excellent : D.
    Excellent job, cheers

  15. January 10th, 2025 at 01:32 | #15

    Hi, constantly i used to check blog posts here early in the daylight, for
    the reason that i like to find out more and more.

  16. January 10th, 2025 at 01:34 | #16

    Your means of describing everything in this post is actually pleasant, all be
    able to simply be aware of it, Thanks a lot.

  17. January 10th, 2025 at 01:36 | #17

    Good day! I could have sworn I’ve visited this site before but
    after browsing through a few of the articles I realized it’s new
    to me. Regardless, I’m certainly pleased I found it and I’ll be bookmarking
    it and checking back often!

  18. January 10th, 2025 at 01:38 | #18

    We are a group of volunteers and opening a new scheme in our
    community. Your web site offered us with valuable info to work on. You have done a formidable job and our entire community will be thankful to you.

  19. January 10th, 2025 at 01:52 | #19

    If some one desires expert view on the topic of running a blog after that i recommend him/her
    to go to see this website, Keep up the nice job.

  20. January 10th, 2025 at 02:07 | #20

    I really like your blog.. very nice colors & theme.

    Did you make this website yourself or did you hire
    someone to do it for you? Plz respond as I’m looking to construct my own blog and would like to know where
    u got this from. thanks

  21. January 10th, 2025 at 02:21 | #21

    We are a gaggle of volunteers and starting a new scheme in our community.
    Your web site offered us with helpful info to
    work on. You have performed a formidable process and our
    whole group might be grateful to you.

  22. January 10th, 2025 at 02:23 | #22

    Tips In Order To Win On The Slot Machine 에볼루션 배팅
    취소 프로그램 (mperspektiva.ru)

  23. January 10th, 2025 at 03:07 | #23

    I like what you guys are usually up too. This sort of clever work and coverage! Keep up the amazing works guys I’ve added you guys to my blogroll.

  24. January 10th, 2025 at 03:09 | #24

    Rifht now itt ppears like Movable Typpe is thee best blogginng platform available right
    now. (from what I’ve read) Is thwt whaqt yoou arre using onn your blog?

  25. January 10th, 2025 at 03:26 | #25

    Incredible points. Sound arguments. Keep up the great effort.

  26. January 10th, 2025 at 03:27 | #26

    of course like your website but you need to test the spelling on several of
    your posts. Several of them are rife with spelling issues
    and I in finding it very troublesome to tell the reality on the other hand I will definitely
    come again again.

  27. January 10th, 2025 at 03:33 | #27

    I truly love your website.. Great colors & theme. Did you make this site yourself?
    Please reply back as I’m planning to create my own website and would love to
    learn where you got this from or exactly what
    the theme is named. Thanks!

Comment pages
1 73 74 75 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