Search code examples
actionscript-3

How to get textfile text to string variable action script 3


I am new to action script. How can I get input textfield value to string or any variable. my code doesn't work


Solution

  • var str:String = myTextField.text;
    

    TextFields 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.