4 Replies Latest reply on Nov 8, 2011 10:49 AM by mythprod2004

    Simulate password masking in a XUL dialog's textbox

    mythprod2004

      Due to a Flash bug in CS5 & CS5.5, I've been forced to generate a dialog with straight XUL instead of XUL opening a swf. I'm trying to stylize the textbox textfield to mask the password entered and I'm having issues coming up with a solution for this. It seems the most straight-forward way to mask would be to assign the textfield a strange font which would serve this purpose - like WingDings. However, i'm not sure of the correct way to stylize a textbox via CSS. I'd like to be able to have the CSS inline in the XUL's XML file, similar to how you can have inline script:

       

      <style type="text/css">

                .passMask {

                          font-family:WingDings;

                }

      </style>

       

      Am I on the right track or can anyone give me insight on how I might go about accomplishing a password mask in a textbox?

       

      Thanks in advance!

        • 1. Re: Simulate password masking in a XUL dialog's textbox
          Ned Murphy Adobe Community Professional & MVP

          I might be wrong, but this doesn't seem to be a Flash-related question. If that's the case and you don't get any help here, you should try asking in the Dreamweaver Forum instead... plenty of CSS experts there (you need to be to use Dreamweaver)..

           

          http://forums.adobe.com/community/dreamweaver/dreamweaver_general?view=discussions

          • 2. Re: Simulate password masking in a XUL dialog's textbox
            mythprod2004 Level 1

            This is not a CSS / Dreamweaver question, this is related to how Flash implements JSFL and XML2UI / XUL to generate dialogs within the Flash interface (this is for a Flash panel I've written).

             

            CS5 & CS5.5 has an error, only on the mac platform, which prevents users from entering the letter "a" more than once when a swf dialog is launched via XUL. To get around this, I re-built the dialog using only XUL which works, but I'm unable to mask the password textbox so it's not hidden during entry. In lieu of a better way to handle this (and I'm open to suggestions), my initial idea was to change the font that textbox uses to WingDings or something else to effectively mask what the user is typing in.

             

            Knowing that at least the Mozilla implementation of XUL is capable of being styled CSS (and they do have a type="password" option for their textboxes, which don't seem to work in the Flash implementation), I'm assuming CSS is my only option within the Flash environment. As already noted, Flash / JSFL seems to have their own take on XUL and I'm not finding the right documentation I need to finish this, so I'm hoping some Flash gurus know how I might be able to handle this.

            • 3. Re: Simulate password masking in a XUL dialog's textbox
              Ned Murphy Adobe Community Professional & MVP

              Please pardon me if I am nowhere near understanding the situation.  I am unfamiiar with whatever bug you might be talking about as far as CS5/5.5 goes, but if you are using a Flash TextField object or a TextInput component, they are both supported by a displayAsPassword property that you can set true and have whatever is entered dispaly as asterisks.

              • 4. Re: Simulate password masking in a XUL dialog's textbox
                mythprod2004 Level 1

                http://dl.dropbox.com/u/27779953/test.mxp

                 

                I've set up a test windowSWF - this will show up as a panel when you open Flash after installing this. Simply double-click it on a machine where the CS suite is installed - extension manager will open and install it. Then open Flash (if it was already open, re-open it). Open the test panel in Windows > Other Panels > test. Once open, you'll notice that it will have one button in the panel called "Launch" - press it. Notice the resulting dialog that shows up - this dialog will contain three textfields to input data. If you're on a Mac on CS5 or CS5.5, notice that you can't type the letter "a" more than once. This is the bug I'm referring to. If you're on a PC, you won't exhibit this behavior.

                 

                To get around this bug, I took the swf dialog out of the equation and built the dialog strictly in XML2UI / XUL - xml below. The problem is, I can't mask the password textbox. I can't do an "onchange" on this textfield because if I replace what the user is typing, the textbox registers that replacement as a change = infinite loop. Flash crashes immediately. The only thing I can think of is to change / stylize the font for just that textbox to something strange like WingDings, so when a user is typing, they can at least keep track of how many characters they are typing but not the actual characters they've typed.

                 

                <?xml version="1.0" ?>

                <dialog id="settings" title="Server Login" buttons="accept,cancel">

                          <grid>

                          <columns>

                                    <column />

                                    <column />

                          </columns>

                                    <rows>

                                              <row>

                                                        <label value="Username" />

                                                        <textbox id="username" value="" tabIndex="1" width="200" />

                                              </row>

                                              <row>

                                                        <label value="Password" />

                                                        <!-- Here's my problem textfield below -->

                                                        <textbox id="pass" value="" html="true" tabIndex="2" width="200" />

                                              </row>

                                              <row>

                                                        <label value="Server Domain " />

                                                        <textbox id="serverAddy" value="" tabIndex="3" width="200" />

                                              </row>

                                    </rows>

                                    <separator/>

                          </grid>

                </dialog>

                 

                Message was edited by: mythprod2004 - took out the onchange="init()" since that function doesn't exist in this test file