all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

Input field doesn't go away?



Input field doesn't go away? Richard Ragon
6/19/2005 11:58:46 PM
flash actionscript: I've created a popup menu screen. Where the use puts in text, and
presses ok, and the menu closes.

I created a MC on top of my stage, placed in it a Input text box, and a
button.

Once the user types into the text field (which is dynamic) and presses
"ok" the MC is suppose to disappear.

The popup menu screen is called, "myInput_MC"

The input is located on the "myInput_MC", and so it the "OK" button.

When the user presses on the "ok", the screen disables and goes _alpha = 0;

script looks like this..

_root.myInput_MC.ok_btn.onRelease = function() {
_root.myInput_MC.enabled = false;
_root.myInput_MC.ok_btn.enabled = false;
_root.myInput_MC._alpha = 0;
};

The screen disappears, but the input text field stays there?? Even
though it's located on the MC "myInput_MC" which goes invisible.

Is this a bug in Flash??

Re: Input field doesn't go away? pukiran
6/20/2005 9:48:20 AM
try using this;
Re: Input field doesn't go away? Richard Ragon
6/21/2005 7:30:06 PM
[quoted text, click to view]

I haven't tried this yet.. but I did find a simi solution for it. It's
wild, but it seams that Input and Dynamic text fields seam to be immune
to actionscript calls. Everything else in the entire MC will disappear
except the text fields?? weird.

The solution was to create a second frame on that particular time line
in that MC. In addition to settings your buttons to enable = false, and
your MC to alpha = 0 I used _root.myInput_MC.gotoAndStop(2);

frame 2 simply just didn't have the text field in it, and all other
objects are there.

Thanks
Re: Input field doesn't go away? NSurveyor
6/22/2005 12:00:00 AM
In order to change the alpha of a textfield (even if it is 0), the font outline
must be embedded, or nothing will happen. You can use the _visible property
because it will just hide it, not make it possibly semi-transparent. To test:
click on that textfield, click the Character button in the Properties Panel (if
you do not see it, click on the down arrow in the bottom right corner of the
panel). Select: Specify Ranges. Then select the first four ranges (uppercase,
lowercase, numerals, and punctuation) Hit OK. Now test, and it should work.

_root.myInput_MC.ok_btn.onRelease = function() {
this._parent.enabled = false;
this.enabled = false;
this._parent._visible = false;
};

(I changed all the absolute paths to relative, looks simpler)
I think the enabled lines are redundant. First you make the whole movieclip
disabled, and then make the button which is in the movieclip disabled which
seems pointless since that movieclip is disabled. Secondly, I think if _visible
is false, then the movieclip is already disabled. So all you need is:

_root.myInput_MC.ok_btn.onRelease = function() {
this._parent._visible = false;
};
AddThis Social Bookmark Button