I am new to action script. How can I get input textfield value to string or any variable. my code doesn't work
var str:String = myTextField.text;
TextField
s have a property known as text
. A property is not quite the same thing as a variable, but it's very similar; you can use it almost the same way. Since a TextField
object has a property called text
, and since it is of type String
, it's as simple as declaring a String
variable, then assigning the property's value to that variable.