private function doQuery():void { queryTask.execute(query, new AsyncResponder(onResult, onFault)); function onResult(featureSet:FeatureSet, token:Object = null):void { // No code needed in this simple sample, since the // graphics layer is bound to the query result using // graphicProvider="{queryTask.executeLastResult.features}" } function onFault(info:Object, token:Object = null):void { Alert.show(info.toString(), "Query Problem"); } } ]]> </fx:Script>
<fx:Declarations>
<!-- Layer with US States --> <esri:QueryTask id="queryTask" showBusyCursor="true" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5" useAMF="false"/>