Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input and dynamic textfields

Status
Not open for further replies.

wreikun

Technical User
Apr 23, 2002
63
0
0
US
Hey everyone. Im new to Flash MX and am already getting stuck on some simple actionscript. Heres what Im aiming to do:

I have a input textfield, a button, and a dynamic text box. When somebody types text in the input textfield and presses the button, that text shows up in the dynamic textbox.

Heres the actionscript that Ive been trying to get to work:

The input textfield's instance name is "textfield01".
The dynamic textbox's instance name is "results01".
The button's instance name is "button01".

The actionscript is as follows in frame 1:

_root.button01.onRelease = function(){
var entered_text01 = textfield01;
_root.results01 == entered_text01;
}

Another alternative I tried was putting the actionscript on the button like so:

on(Release){
var entered_text01 = textfield01;
_root.results01 == entered_text01;
}

However, neither of these prints anything in the dynamic text box. After I enter some text and press the button, nothing shows up.

Any help is appreciated.

--REI
 
/*
The input textfield's instance name is "textfield01".
The dynamic textbox's instance name is "results01".
The button's instance name is "button01".

The actionscript is as follows in frame 1:
*/

stop();

_level0.button01.onRelease = function(){
_level0.entered_text01 = textfield01.text;
_level0.results01.text = _level0.entered_text01;
}

The above works marvels! Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top