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. December 2nd, 2019 at 03:25 | #1

    you will have an amazing weblog here! would you wish to make some invite posts on my weblog?

  2. December 4th, 2019 at 11:57 | #2

    Well I truly liked reading it. This tip offered by you is very useful for accurate planning.

  3. December 19th, 2019 at 22:32 | #3

    I was impressed by the good writing.Thank you.
    If you want to know the social graph game, come here!

    홀덤사이트
    홀덤
    온라인홀덤
    텍사스홀덤
    홀덤추천
    텍사스홀덤사이트
    온라인홀덤사이트
    https://www.holdem-79.com

    I was recommended this website by my cousin. I am no longer certain whether
    this submit is written through him as no one else recognise such certain approximately my trouble.
    You’re amazing! Thank you!

  4. December 23rd, 2019 at 01:15 | #4

    Major thankies for the blog article. Will read on

  5. December 31st, 2019 at 04:06 | #5

    Really informative article post.Really thank you! Want more.

  6. January 13th, 2020 at 04:10 | #6

    It will put the value he invested in the house at risk to offer into through the roof

  7. January 14th, 2020 at 12:03 | #7

    In today’s time bodily health is of utmost relevance.

  8. January 14th, 2020 at 13:10 | #8

    Some of the first things to remember along with fitness and health supplements for women is actually that a lot of these have certainly not been technically checked.

  9. January 27th, 2020 at 17:41 | #9

    Thanks for some other informative web site. Where else may just
    I get that kind of information written in such a perfect manner?
    I’ve a challenge that I’m simply now working
    on, and I’ve been at the look out for such info.

  10. February 2nd, 2020 at 12:09 | #10

    And when they do, you can anticipate to pay a premium for nature’s fragrance; Clark estimates an additional fragrant flower will price an extra
    10 cents.

  11. February 3rd, 2020 at 16:47 | #11

    You can certainly see your skills in the work you write. The world hopes for more passionate writers like you who aren at afraid to say how they believe. Always follow your heart.

  12. February 17th, 2020 at 09:25 | #12

    Its hard to find good help I am regularly proclaiming that its hard to get good help, but here is

  13. February 24th, 2020 at 03:44 | #13

    Really informative article post.Really looking forward to read more.

  14. March 3rd, 2020 at 06:05 | #14

    Ponto IPTV a melhor programacao de canais IPTV do Brasil, filmes, series, futebol, lutas, shows, documentarios em alta definicao de imagem e som em SD, HD, FULL HD, 4K. compativel com todos aparelhos do mercado Brasileiro.

  15. March 9th, 2020 at 03:39 | #15

    This site truly has all of the information and facts I needed about this subject and didn at know who to ask.

  16. March 18th, 2020 at 10:41 | #16

    Your style is so unique compared to other people I have read stuff from. Thank you for posting when you ave got the opportunity, Guess I all just book mark this site.

  17. April 11th, 2020 at 05:32 | #17

    I don’t even understand how I stopped up right here,
    but I believed this post used to be good. I do not recognize who
    you might be however definitely you are going to a well-known blogger when you aren’t already.
    Cheers!

  18. April 11th, 2020 at 05:57 | #18

    Remarkable! Its really awesome post, I have got much clear
    idea regarding from this piece of writing.

  19. April 13th, 2020 at 04:48 | #19

    You could certainly see your expertise in the work you write.

  20. April 18th, 2020 at 10:27 | #20

    Good answers in return of this query with real arguments and telling all
    regarding that.

  21. May 9th, 2020 at 18:59 | #21

    Hi everyone, it’s my first go to see at this site, and article is
    truly fruitful in favor of me, keep up posting these content.

  22. May 16th, 2020 at 18:31 | #22

    Dies ist bekanntermaßen astrein, Besten Dank! Dies hat mir gefallen und ist
    besonders wissenswert. Die Gedankenfinde ich eingängig.
    Ebendiese Gedanken sind mir ebenfalls sehr wohl durch den Denkapparat gegangen. Denn ich denke, dass dies
    ferner zu Gunsten von meinen Lesern ein bemerkenswertes Anliegen scheint.

  23. June 22nd, 2020 at 04:56 | #23

    I think this is a real great blog article. Really Great.

  24. June 22nd, 2020 at 06:17 | #24

    Thanks a lot for the blog post.Much thanks again. Keep writing.

  25. June 26th, 2020 at 02:47 | #25

    The loans may also be given at very strict terms as well as any violations will attract huge penalties super real property tax

  26. July 19th, 2020 at 10:59 | #26

    magnificent issues altogether, you simply gained a new reader. What would you recommend about your put up that you simply made some days ago? Any certain?

  27. July 22nd, 2020 at 14:38 | #27

    wow, awesome blog post.Really thank you!

  28. July 26th, 2020 at 23:12 | #28

    Purple your website post and loved it. Have you at any time believed about guest publishing on other associated blogs equivalent to your site?

  29. August 6th, 2020 at 08:51 | #29

    This very blog is really cool and besides amusing. I have discovered many interesting things out of it. I ad love to visit it over and over again. Thanks a lot!

  30. August 12th, 2020 at 23:53 | #30

    Hardwood household furniture has one thing quite organic concerning
    it. There is this feeling of heat, of attributes and
    of style that may be actually be found in wood home furniture.

    Wood is actually birthed coming from the planet.

  31. August 12th, 2020 at 23:59 | #31

    Good work over again! I am looking forward for your next post!

  32. August 13th, 2020 at 21:43 | #32

    How will you like to bypass the higher market prices at the
    furniture outlets by using hardwood home furniture strategies as
    well as create some on your own? It is feasible as well as a ton of folks
    are actually actually doing it. As opposed of
    what lots of people presume, it is actually certainly not important to be a professional to
    produce wood furniture.

  33. August 17th, 2020 at 08:54 | #33

    when i was when i was still a kid, i was already very interested in business and business investments that is why i took a business course**

  34. August 28th, 2020 at 21:15 | #34

    I think that is one of the such a lot important information for
    me. And i’m glad reading your article. However should observation on some normal issues, The web site taste is wonderful, the articles is truly nice :D .

    Just right task, cheers.

  35. September 6th, 2020 at 08:15 | #35

    It as not that I want to replicate your web site, but I really like the style. Could you tell me which theme are you using? Or was it custom made?

  36. September 14th, 2020 at 06:01 | #36

    Thanks for another excellent article. Where else could anyone get that type of info in such an ideal way of writing? I have a presentation next week, and I am on the look for such information.

  37. September 14th, 2020 at 06:39 | #37

    Some really interesting information, well written and generally user genial.

  38. September 27th, 2020 at 06:52 | #38

    Excellent website you have here but I was wondering if you knew of any discussion boards that cover the same topics discussed in this article?
    I’d really love to be a part of community where I can get suggestions from other experienced individuals that share the same interest.
    If you have any suggestions, please let me know. Bless you!

  39. November 9th, 2020 at 03:30 | #39

    As aⅼway, very good blog! Ι read yoᥙr blog on a regular basіѕ
    and you’re always coming ouut with some very nice stuff. Ӏ’ll make surе too share tһis onn my Facebook page and my followers shoyld like thіs aѕ ԝell.
    ᛕeep up the grеat work!

  40. November 17th, 2020 at 08:08 | #40

    May I just say what a comfort to discover someone that genuinely
    understands what they are discussing online. You actually realize how to bring a
    problem to light and make it important. More people
    ought to check this out and understand this side of
    your story. It’s surprising you aren’t more popular given that you certainly possess the gift.

  41. November 21st, 2020 at 20:30 | #41

    If some one needs expert view regarding blogging and site-building then i recommend him/her to go to see this weblog, Keep up the fastidious job.

  42. December 31st, 2020 at 14:59 | #42

    A woman that I can love and cherished with all my whole being and heart and I pray to God almighty that he will provide me with that kind of a woman someday in my life.

  43. January 2nd, 2021 at 11:05 | #43

    When someone writes an post he/she maintains the idea of a user in his/her brain that how a user can understand it.
    Thus that’s why this article is amazing. Thanks!

  44. January 5th, 2021 at 08:37 | #44

    whoah this blog is excellent i like studying your articles.

    Keep up the good work! You understand, lots of people are looking aroound for this info, you could aid them greatly.

  45. January 22nd, 2021 at 07:05 | #45

    Hi.

    I would like to tell you that I’m visiting this site foor some time and you share really good content.
    I shared your newset post on twitter and got a lot oof good feedbacks.

    Waitimg for your next article

  46. February 2nd, 2021 at 11:56 | #46

    Excellent way of describing, and nice article to take
    data on the topic of my presentation subject,
    which i am going to present in college.

  47. February 10th, 2021 at 14:22 | #47
  48. February 10th, 2021 at 14:22 | #48
  49. February 10th, 2021 at 14:22 | #49
  50. February 25th, 2021 at 15:35 | #50

    When some one searches for his necessary thing, so he/she wishes to be
    available that in detail, so that thing is maintained over here.

Comment pages
1 14 15 16 17 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