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!
it’s ok to not be ok
CHRIST LIVES IN ME
The greatness of the power of nature
It’s an remarkable piece of writing designed
for all the internet visitors; they will get advantage from it I
am sure.
The greatness of the power of nature
As mentioned, traditional bag vacuums often create really in pretty
baad shape compared to what they tidy up, as there
is more often than not a spill from the dirt and dust
when changing or disposing of bags, creating the mess tat you had just cleaneed up.
Bagged hoovers are usually used in places like hospitals and
offices where they do not have time for it to continue the equipment.
So as the Regina Housekeeper Plus was ideal for her, it
had noot been really suitable for me.
You don’t want to play 1 note for the entire song, but you don’t wanjt
to jump around also speedy either.
Having read this I believed it was extremely enlightening.
I appreciate you finding the time and energy to put this informative article together.
I once again find myself personally spending a significant amount of time both reading and commenting.
But so what, it was still worthwhile!
Nice answers in return of this matter with genuine arguments and explaining everything regarding that.
Thanks a lot for being my own mentor on this subject matter.
I actually enjoyed your article quite definitely and most of all preferred
how you handled the areas I widely known as controversial.
You’re always extremely kind to readers like me and assist me
to in my life. Thank you.
Magnificent web site. Plenty of helpful information here.
I am sending it to several friends ans additionally
sharing in delicious. And obviously, thank you to your effort!
I don’t know whether it’s just me or if perhaps everyone else experiencing problems with your blog.
It appears as if some of the text on your posts are running off the screen. Can somebody else please provide feedback and let me know if
this is happening to them too? This may be a problem with
my browser because I’ve had this happen previously.
Appreciate it
Hi there, always i used to check website posts here early in the daylight,
since i like to gain knowledge of more and more.
Hi, all the time i used to check blog posts here early in the morning, for the reason that i like to learn more and more.
リアルドール
ラブドール
I don’t even know how I finished up right here, but I believed this put up was great.
I do not recognise who you might be however certainly you are going
to a famous blogger in the event you aren’t already. Cheers!
Actually no matter if someone doesn’t know then its up
to other viewers that they will assist, so here it occurs.
Your ability to enhance complicated subject matters right into digestible content is admirable.
This article, especially, stands as a testament to your devotion to encouraging
expertise. It’s very clear that you strive to create a meaningful impact.
Creating triggers curiosity, encouraging
wish for know-how. Dedication to educating and also sharing wisdom is genuinely inspiring.
That is ɑ ery good tip especially to those new too thhe
blogοѕphere. Brief bᥙt very precise info… Appreciɑte your sharing this one.
A mut read aгticle!
Thanks for finally writing about >Flex 4: Changing the “displayAsPassword” default character | eonflex.com <Liked it!
Hi there friends, its wonderful paragraph
about cultureand completely defined, keep it up all
the time.
I do not know whether it’s just me or if everybody else encountering issues with your website.
It seems like some of the written text on your content are running off the screen. Can someone else please provide feedback
and let me know if this is happening to them
as well? This could be a issue with my web browser because I’ve had this happen before.
Cheers
Nicely put, Kudos.
Thanks a lot, Numerous stuff.
my webpage – http://ldm.sakura.ne.jp/balu+bbbs/album/album.cgi?mode=detail&no=128