Call web service in Button click event handler
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:WebService id="survey" wsdl="http://server.com/Survey.php?wsdl"> <mx:operation name="getAverages" resultFormat="object" /> </mx:WebService> <mx:HBox> <mx:VBox> <mx:Button id="getAveragesButton" label="Get Averages" click="survey.getAverages.send( )" /> <mx:TextInput id="resultFlash" enabled="false" /> <mx:TextInput id="resultActionScript" enabled="false" /> </mx:VBox> </mx:HBox> </mx:Application>