Use Web service to validate input
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.rpc.soap.LoadEvent; import mx.controls.Alert; private function loadHandler(event:LoadEvent):void { trace(event.wsdl.xml); } private function resultHandler(event:ResultEvent):void { trace(event.result as String); } private function faultHandler(event:FaultEvent):void { Alert.show(event.fault.faultString); } </mx:Script> <mx:WebService id="myWebService" wsdl="http://server.com/service.php?WSDL" load="loadHandler(event)" result="resultHandler(event)" fault="faultHandler(event)" /> <mx:Button id="myButton" label="OK" click="myWebService.valid('not a number')" /> </mx:Application>