MXML and Script
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> import mx.controls.*; private function clickHandler(event:MouseEvent):void { myLabel.text = event.type + ": " + myInput.text; Alert.show("Text Entered is:\n" + myInput.text, "Alert Box", Alert.OK); } </mx:Script> <mx:TextInput id="myInput" width="150"/> <mx:Label id="myLabel" width="150"/> <mx:Button id="myButton" label="Enter Text" click="clickHandler(event)"/> </mx:Application>