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. February 13th, 2018 at 15:41 | #1

    Thanks for finally talking about >Flex 4: Changing the “displayAsPassword”
    default character | eonflex.com <Liked it!

  2. February 14th, 2018 at 21:01 | #2

    You need to be a part of a contest for one of the most useful blogs on the net.

    I’m going to recommend this blog!

  3. February 16th, 2018 at 12:36 | #3

    Wohh just what I was looking for, appreciate it for putting up.

  4. February 17th, 2018 at 20:04 | #4

    At this time it looks like Expression Engine is the top blogging platform available right now.
    (from what I’ve read) Is that what you’re using on your blog?

  5. February 18th, 2018 at 01:13 | #5

    I’m pretty pleased to uncover this website.
    I want to to thank you for your time for this particularly fantastic read!!
    I definitely savored every bit of it and i also have you saved to
    fav to see new information in your blog.

  6. February 18th, 2018 at 10:21 | #6

    Your style is unique in comparison to other people I’ve read stuff from.

    Thanks for posting when you’ve got the opportunity, Guess I’ll just bookmark this site.

  7. February 18th, 2018 at 16:51 | #7

    My developer is trying to persuade me to move to .net
    from PHP. I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using WordPress
    on various websites for about a year and am concerned about switching to another platform.
    I have heard very good things about blogengine.net. Is there
    a way I can transfer all my wordpress content into it? Any help would be greatly appreciated!

  8. February 18th, 2018 at 18:49 | #8

    A smartphone also is likewise more useful thnan the Oculus, consisting of for things besides
    home entertainment. Additionally, peeople who buyy them normally already have cellular phone
    bills, so that part does nnot enhance the overall expenditure.

  9. February 26th, 2018 at 09:17 | #9

    First of all I want to say terrific blog! I had a quick question that I’d like to ask if you
    do not mind. I was interested to find out how you center yourself and clear your mind before writing.
    I have had a tough time clearing my mind in getting my
    ideas out there. I truly do take pleasure in writing however it just seems like the first
    10 to 15 minutes are generally lost just trying to figure out
    how to begin. Any suggestions or tips? Appreciate it!

  10. March 10th, 2018 at 00:59 | #10

    Great site you have here but I was curious about if
    you knew of any forums that cover the same topics discussed in this article?
    I’d really love to be a part of group where I can get responses from other knowledgeable individuals that share the same interest.
    If you have any recommendations, please let me
    know. Thanks!

  11. March 10th, 2018 at 08:27 | #11

    This idea was the developed and after prototypes were
    manufactured the theory was further resulted in a mobile phone oral appliance thus the i – Phone was
    born. i – Phone 5 specifications leaked: Design data is available before the formal release date – The specifications of the gadget are not released formally yet.iphone 8 plus cu mau den The
    company has postponed the production of the much awaited
    i – Phone 5, paving just how for the i – Phone 4 successor, the i – Phone 4S.

  12. March 11th, 2018 at 08:38 | #12

    Its not my first time to go to see this website, i am browsing
    this web page dailly and get good data from here daily.

  13. March 17th, 2018 at 14:42 | #13

    Hi, just wanted to tell you, I loced this article.
    It was funny. Keep on posting!

  14. March 18th, 2018 at 19:02 | #14

    It’s awesome for me to have a web page, which is valuable designed for
    my know-how. thanks admin

  15. March 21st, 2018 at 00:20 | #15

    Simply want to say your article is as astonishing.
    The clarity to your submit is just cool and i could suppose you are knowledgeable on this subject.

    Fine together with your permission let me to snatch your RSS feed to
    stay updated with coming near near post. Thanks one million and please keep
    up the gratifying work.

  16. March 25th, 2018 at 03:12 | #16

    It’s going to be end of mine day, however before finish I am reading this
    enormous piece of writing to improve my experience.

  17. April 1st, 2018 at 02:46 | #17

    The Clash of Clans Mod 2017 allows to do so much more than you are able to do on the
    peculiar Conflict of Clans.

  18. April 18th, 2018 at 03:10 | #18

    With havin so much content and articles do you ever run into any issues of plagorism or copyright
    infringement? My blog has a lot of exclusive content I’ve either written myself or outsourced but it looks like a lot of it is popping
    it up all over the internet without my permission. Do you know any methods to help reduce
    content from being stolen? I’d certainly appreciate it.

  19. April 18th, 2018 at 17:59 | #19

    Excellent post, you have stated some excellent details, I
    think this is an excellent web site.

  20. April 20th, 2018 at 06:38 | #20

    Hi, after reading this remarkable paragraph i am too glad to share my experience
    here with colleagues.

  21. April 28th, 2018 at 22:37 | #21

    Hi, its pleasant piece of writing on the topic of media print, we all understand media is a impressive source oof data.

  22. May 4th, 2018 at 19:39 | #22

    It’s going to be ending of mine day, but before end I am reading this fantastic piece of writing to increase my know-how.

  23. May 19th, 2018 at 12:02 | #23

    Once yoou might have fߋund an email finder service ʏoᥙ want to usе, maintain the numbеr prߋvided with уⲟu in any respect timеs.
    If you are over a busy highway witһ speeding cars oг end up struggling to arrive at tһe siɗе
    inn thе road, STAY IN УOUR CAR. You can bе your ⲟwn boss, and wⲟrk forr yourseⅼf,
    if ү᧐u start yohr personal towig service business, аnd makoe it single mɑn job,
    or convert іt іnto a flewt of towing vehicles.

  24. June 13th, 2018 at 12:24 | #24

    Hmm is anyone else encountering problems with the images on this blog loading?
    I’m trying to determine if its a problem on my end
    or if it’s the blog. Any feed-back would be greatly appreciated.

  25. June 14th, 2018 at 05:09 | #25

    After I originally left a comment I seem to have clicked on the -Notify me when new
    comments are added- checkbox and now every time a comment is added I get four emails with
    the exact same comment. Is there a means you can remove me from that service?
    Appreciate it!

  26. June 17th, 2018 at 22:20 | #26

    It’s fantastic that you are getting thoughts
    from this piece of writing as well as from our dialogue made at this time.

Comment pages
1 11 12 13 435
  1. March 19th, 2014 at 11:13 | #1
  2. April 30th, 2014 at 01:00 | #2