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. April 26th, 2014 at 08:59 | #1

    ¿Qué está pasando a cada uno , los contenidos existente en este sitio web son de hecho, awesome
    conocimiento , así , mantener el buen bueno trabajar compañeros.

  2. April 26th, 2014 at 11:01 | #2

    gonfanon gonglike gonidial gonidium gonocyte gonopore
    goodbyes goodlier. shelver  shelves  sheqels  sherbet  shereef  sheriff
     sherifs  sheroot. cupcake  cupeled  cupeler  cupfuls  cuplike
     cupolas  cuppers  cuppier.

  3. April 27th, 2014 at 11:06 | #3

    Hi, I do believe this is an excellent blog. I stumbledupon it ;)
    I’m going to revisit once again since I book-marked it. Money and
    freedom is the greatest way to change, may you be rich and continue to guide other people.

  4. April 27th, 2014 at 23:22 | #4

    Thanks for sharing your thoughts on acne scars.

    Regards

  5. April 28th, 2014 at 03:25 | #5

    Hi there, I found your website by the use of Google
    whilst searching for a comparable subject, your website got here up,
    it looks good. I’ve bookmarked it in my google bookmarks.

    Hello there, simply was alert to your blog through Google, and found that
    it is really informative. I’m going to be careful
    for brussels. I’ll appreciate in case you continue this in future.

    A lot of people will be benefited from your writing. Cheers!

  6. April 28th, 2014 at 04:53 | #6

    Offered that actual physical phenomenon could be core cause for imbalances
    connected goods inside your grocery store, make sure you are going to do holiday and it could be constant actual physical confirmations by means of compost bin invitation as
    web store journal as well as remodeling help and
    support correctness when employing perpetual catalog
    facilities. Cover it with a layer of brown materials like wood chips, dry hay and sawdust to prevent flies
    from buzzing about and odors from seeping through.
    Today we’ll concentrate on materials for collection so that by April, your compost heap will
    be ready for use.

  7. April 28th, 2014 at 11:03 | #7

    I go to see day-to-day some web sites and blogs to read articles, except
    this webpage gives quality based content.

  8. April 29th, 2014 at 00:46 | #8

    My soil is always wet in the spring because it contains a lot of clay.
    Simply use sticks or canes and some Figo Universal Frame Connectors to turn
    your Wood – Bloc – X raised bed into a mini-cold frame.
    Watercress is really a pleasure to have in your own backyard garden specifically if you have a stream or
    perhaps a pond to grow it.

  9. April 29th, 2014 at 06:13 | #9

    He said their spirits were haunting the palace of Jaganmohan Reddy now.
    “La Gaia” is an upscale restaurant that is located in an antique villa with an interior courtyard that is centered around a pool.
    Is he really someone that people in a modern, progressive and free society should place on a pedestal.

  10. April 29th, 2014 at 06:31 | #10

    Great blog right here! Additionally your website loads up fast!
    What host are you using? Can I am getting your associate hyperlink to your host?
    I desire my site loaded up as quickly as yours lol

  11. April 29th, 2014 at 16:38 | #11

    Does your blog have a contact page? I’m having trouble locating it but, I’d
    like to shoot you an email. I’ve got some ideas for your blog you might be interested in hearing.

    Either way, great site and I look forward to seeing it improve over time.

  12. April 30th, 2014 at 23:37 | #12

    Vinyl replacement windows aare also very cost effective inn that they
    form a very good barrier between the outside atmosphere and the inside oone making your need foor air conditioning much
    less. A new dokor can exponentially increase your curb appeal and freshen up the look of
    your home. Replacing yokur oold windows with new ones will keep the temperature inside your home more constant, and save
    you lots of money oon utility bills.

  13. May 1st, 2014 at 09:37 | #13

    Remarkable things here. I am very happy to look your article.
    Thank you a lot and I’m taking a look forward
    to touch you. Will you please drop me a e-mail?

  14. May 1st, 2014 at 23:59 | #14

    Thanks for your thoughts. One thing I’ve noticed is that often banks as well
    as financial institutions have in mind the spending routines of consumers
    and understand that most people max out there their credit cards around the vacations.
    They prudently take advantage of this fact
    and begin flooding the inbox and snail-mail box together with hundreds of no interest APR credit card
    offers immediately after the holiday season comes to an end.
    Knowing that if you’re like 98% in the American community, you’ll jump at the possiblity to consolidate personal credit card debt and transfer balances to 0 APR credit cards.

  15. May 2nd, 2014 at 14:14 | #15

    Modifications may be made for students according to their special
    needs. The interior and exterior paint of your house will by and large rely on
    upon the shades of the quick environment that encompasses it.
    Ira becomes the movie’s heart and moral compass as he comes
    to tell this miserable movie star what he needs to
    hear as opposed to what he wants to hear. Actually many “generic” brands are manufactured by
    the brand name companies only they don’t have their name plastered
    all over the product. Cooking, music and water recreation are oft times hobbies and
    pursuits of those born under the sign of Cancer.

  16. May 3rd, 2014 at 01:47 | #16

    For latest news you have to go to see internet and on web I found
    this web site as a best website for newest updates.

  17. May 3rd, 2014 at 13:24 | #17

    Excellent post. I was checking continuously this blog and I am impressed!

    Extremely useful info specifically the last part :) I care for such information much.
    I was looking for this particular information for a very long time.
    Thank you and good luck.

  18. May 3rd, 2014 at 23:55 | #18

    It’s not my first time to pay a visit this
    web page, i am browsing this site dailly and take pleasant data from here
    daily.

  19. May 4th, 2014 at 07:33 | #19

    magnificent points altogether, you just received a logo new
    reader. What could you suggest in regards to your publish that you
    made some days ago? Any positive?

  20. May 4th, 2014 at 12:25 | #20

    Write more, thats all I have to say. Literally, it seems as though you
    relied on the video to make your point. You clearly know what youre talking
    about, why waste your intelligence on just posting videos to your site when
    you could be giving us something informative
    to read?

  21. May 4th, 2014 at 14:34 | #21

    First off I would like to say awesome blog!
    I had a quick question that I’d like to ask if you do
    not mind. I was curious to find out how you center yourself and clear your mind before writing.

    I have had trouble clearing my mind in getting my ideas out.
    I truly do enjoy writing but it just seems like the first
    10 to 15 minutes tend to be wasted just trying to figure out how to begin.
    Any ideas or hints? Kudos!

  22. May 4th, 2014 at 15:46 | #22

    Thanks , I have just been looking for information approximately
    this topic for a while and yours is the greatest
    I have discovered so far. However, what about the bottom line?

    Are you sure in regards to the supply?

  23. May 4th, 2014 at 17:13 | #23

    They are no joke and shouldn’t be taken frivolously.
    However, treasury bills are not a part of the strategy.
    Jamaica even introduced the Jamaica Financial debt Trade (JDX) plan to restructure its domestic debt.

  24. May 4th, 2014 at 18:10 | #24

    Wow! Finally I got a web site from where I can really take useful data concerning my study and
    knowledge.

  25. May 5th, 2014 at 22:16 | #25

    Wow, this piece of writing is good, my younger sister is analyzing these kinds of things, so I am going to inform her.

  26. May 7th, 2014 at 03:38 | #26

    Ӏn June, the policy of ‘for thе people despitе
    the people’ is Һome harrow green removals leeds bankrupt.
    Expect social media platforms, Һome harrow greenn removals leeds
    ɑnd аllows brands tο гun effective campaigns tߋ increase their website traffic.

  27. May 7th, 2014 at 16:47 | #27

    Ahaa, its pleasant conversation concerning this article here
    at this blog, I have read all that, so at this time me also commenting at
    this place.

  28. May 8th, 2014 at 06:11 | #28

    Great blog! Do you have any suggestions for aspiring writers?
    I’m planning to start my own site soon but I’m a little lost on everything.
    Would you propose starting with a free platform like WordPress or go for a paid option?
    There are so many choices out there that I’m completely overwhelmed ..
    Any recommendations? Cheers!

  29. May 8th, 2014 at 09:28 | #29

    I’m extremely pleased to discover this website.
    I need to to thank you for ones time for this particularly fantastic read!!
    I definitely really liked every part of it and i also
    have you book-marked to check out new information on your site.

  30. May 8th, 2014 at 14:42 | #30

    It’s hard to come by knowledgeable people for this topic, but
    you sound like you know what you’re talking about!
    Thanks

  31. May 8th, 2014 at 16:40 | #31

    I’ve been exploring for a little for any high quality articles or blog posts in this sort
    of house . Exploring in Yahoo I eventually stumbled upon
    this web site. Studying this information So i am satisfied to exhibit
    that I have an incredibly good uncanny feeling I discovered just
    what I needed. I most indisputably will make sure
    to do not forget this site and provides it a glance regularly.

  32. May 8th, 2014 at 19:27 | #32

    I do not even understand how I ended up here, but I believed this post was once good.
    I do not recognize who you might be but definitely you’re going to a well-known blogger in case you
    aren’t already. Cheers!

  33. May 8th, 2014 at 22:24 | #33

    I was able tto find good advice from уour articles.

  34. May 8th, 2014 at 22:28 | #34

    Looking for Black Scale Discounts?

  35. May 8th, 2014 at 23:11 | #35

    Its like you learn my thoughts! You appear to understand so much approximately this, such as you wrote the ebook in it or something.
    I believe that you just can do with some p.c. to drive the
    message home a bit, but instead of that, this is fantastic
    blog. An excellent read. I’ll definitely be back.

  36. May 9th, 2014 at 04:20 | #36

    Do you have a spam problem on this site; I also am a blogger,
    and I was curious about your situation; we have created some nice methods and we are
    looking to exchange strategies with others, be sure to shoot
    me an email if interested.
    Pretty part of content. I just stumbled upon your
    weblog and in accession capital to say that I get in fact loved account your weblog posts.

    Any way I will be subscribing to your augment and even I achievement you get entry to consistently rapidly.

  37. May 10th, 2014 at 16:32 | #37

    At Halloween, something extravagant and a little weird will make for a much more mysterious evening.
    Whilst there are nonetheless factors in play that need persistence, overall things start to loosen up.

  38. May 10th, 2014 at 19:19 | #38

    Greetings! Very helpful advice within this article! It’s the little changes that produce the biggest changes.

    Thanks for sharing!

  39. May 13th, 2014 at 16:52 | #39

    Hi, this weekend is fastidious in support of me, as this occasion i
    am reading this enormous educational post here at my house.

  40. May 14th, 2014 at 19:06 | #40

    An intriguing discussion is worth comment.

    I do believe that you ought to publish more on this subject matter,
    it might not be a taboo matter but usually people do not discuss such issues.
    To the next! Kind regards!!

  41. May 16th, 2014 at 04:42 | #41

    There’s definately a great deal to know about this subject.
    I really like all of the points you’ve made.

  42. May 16th, 2014 at 07:04 | #42

    Amazing things here. I am very happy to look your post.
    Thanks a lot and I’m having a look ahead to contact you.
    Will you please drop me a mail?

  43. May 16th, 2014 at 20:03 | #43

    We stumbled over here different web page and thought I might check things out.
    I like what I see so now i am following you. Look forward
    to exploring your web page again.

  44. May 16th, 2014 at 20:44 | #44

    You have made some decent points there. I looked on the net for more info about the issue and found most people will
    go along with your views on this site.

  45. May 17th, 2014 at 01:41 | #45

    So if you have ever asked yourself “What is the fastest way to make money. Have you typed into Google “how
    can I earn online and come” across a few through products that seem too good to be true. Depending on the approaches that you put in place, you stand to make varying amount of money.

  46. May 17th, 2014 at 02:02 | #46

    Rust JackeD v1.1.4 Download
    Link: http://bit.ly/1oUfW1Z

    This hack is the mother of all rust hacks, you won’t
    die against any other payhack anymore if you use it correctly.
    It works on steam and emulated rust.
    Cheatpunch and VAC bypassed (1.1.4).

  47. May 20th, 2014 at 11:28 | #47

    I used to be suggested this web site via my cousin. I’m now not positive whether this publish is
    written by way of him as nobody else realize such
    distinct approximately my difficulty. You are incredible!
    Thank you!

  48. May 21st, 2014 at 12:57 | #48

    Hi! I know this is kinda off topic but I was
    wondering which blog platform are you using for this website?
    I’m getting tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform.
    I would be awesome if you could point me in the direction of
    a good platform.

  49. May 22nd, 2014 at 16:49 | #49

    This site was… how do I say it? Relevant!!
    Finally I have found something that helped me. Kudos!

  50. May 23rd, 2014 at 22:11 | #50

    I blog quite often and I seriously appreciate your information. This article has really
    peaked my interest. I am going to book mark your website and keep
    checking for new details about once per week. I subscribed
    to your Feed as well.

Comment pages
1 2 3 4 5 15 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