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!
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.
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
This website certainly has all the information I wanted concerning this
subject and didn’t know who to ask.
Hi, this weekend is nice designed for me, because this moment i am reading
this great educational paragraph here at my house.
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?
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?
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?
I am sure this post has touched all the internet users, its really really good post on building up new weblog.
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!
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.
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!
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.
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!
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!
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!
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!
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.
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.
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.
. . . . .
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!
Great article.
Nicely put. With thanks!
bokep terbaik sma toket gede menyala banget
Easy going and with a lovely personality, Sandra is fully qualified to teach in both manual and automatic cars.
Gary also teaches in medium and heavy goods trucks along with a car and a trailer.
I feel my pupils are in capable hands when they call my office.
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!
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.
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!
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
Hi, after reading this awesome piece of writing i am too cheerful to share my knowledge here with mates.
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!
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.
Hi there, just wanted to mention, I loved this article.
It was helpful. Keep on posting!