On value commit in a TextInput control, use alert to display the input value
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.controls.Alert; public function showMsg(msg:String):void { Alert.show(msg); } </mx:Script> <mx:Panel title="Profile" verticalCenter="0" horizontalCenter="0"> <s:Label text="Enter your name" fontWeight="bold" /> <mx:TextInput id="yourName" valueCommit="showMsg(yourName.text)" /> </mx:Panel> </mx:Application>