Forum Moderators: open

Message Too Old, No Replies

How do I get at a text input field from action script?

         

BitShift

3:20 pm on Aug 20, 2007 (gmt 0)

10+ Year Member



newbie alert!

Flash CS3
Ive got a text input field in my flash file and i just cant seem to grab the text in the text field. Ive given the text input field an instance name and a variable name from the property inspector.

Here is my actionscript
on (rollOver) {
gotoAndPlay("over");
}
on (releaseOutside, rollOut) {
gotoAndPlay("out");
}
on (release) {
//getURL("www.adobe.com");
var goURL = "test.aspx";
trace("goURL is: " + goURL);
trace("txtZipSearch is: " + txtZip.text);
}

the output is...
goURL is: test.aspx
txtZipSearch is:

[edited by: BitShift at 3:22 pm (utc) on Aug. 20, 2007]

alexdunae

9:39 pm on Sep 6, 2007 (gmt 0)

10+ Year Member



It looks like you are out of scope.

Try accessing it with

_root.txtZip.text

wedmaster

4:10 am on Sep 9, 2007 (gmt 0)

10+ Year Member



on (release) {
//getURL("www.adobe.com");
var goURL = "test.aspx";
trace("goURL is: " + goURL);
trace("txtZipSearch is: " + txtZip.text);
}

variable txtZip.text is in the button,in fact,txtZip.text is outside of the button,so you can't get it.