Set value from TextInput to a variable
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> public var myVar:String; public function setMyVar():void { myVar = myText.text; } </mx:Script> <mx:TextInput id="myText" /> <mx:Button click="setMyVar()" label="Set Variable" /> </mx:Application>