Input Text
Simple question for most, but the technical challenged……me.
Already spent over an hour looking for an answer.
I have an input text box.
It’s instance name is “level_txt”
How do I get the value that is in the text box ?
button1.onPress = function() {
trace ("the value in the input box is “ + level_txt.text); //?????? does not work
}
thanks
Mal
You probably need to modify the path to the text field...in the code above, the button will be looking for the level_txt textfield inside button1...
Try:
code:
button1.onPress = function() {
trace ("the value in the input box is “ + _root.level_txt.text);
}
K.
Thanks K
but that did not work.
Obviously I am doing something wrong in my codeing.
I must have my code in the wrong place.
I would appreciate if you would look at it.
It’s frustrating, as I know how to code in VB but I am totally lost in flash.
I guess there is no substitute for experience and that takes time.
mal
Attached Files
Your current code has:
code:
button1.onPress = function() {
trace ("here I am " + _root.Level_txt);
}
Change it to:
code:
button1.onPress = function() {
trace ("here I am " + _root.Level_txt.text);
}
Also, note that Flash is case-sensitive - so level_txt is not the same as Level_txt...
K.
Thanks K
didn't know about the case-sensitive thing as well.
mal
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width