hello guys i developed a model that works with webservice's value. I published my model (the model is without params) as GP Service (Sync.) in a Flex Application with this code: this is my script <fx:Script> <![CDATA[ import com.esri.ags.FeatureSet; import com.esri.ags.Graphic; import com.esri.ags.events.GeoprocessorEvent; import com.esri.ags.events.MapMouseEvent; import com.esri.ags.events.QueryEvent; import com.esri.ags.geometry.MapPoint; import com.esri.ags.symbols.SimpleFillSymbol; import com.esri.ags.symbols.SimpleLineSymbol; import com.esri.ags.symbols.SimpleMarkerSymbol; import com.esri.ags.tasks.supportClasses.ParameterValue; private var gpPending:Boolean; private function Button_Click():void { var featureSet:FeatureSet = new FeatureSet(); var params:Object = { }; gp.execute(params); gpPending = true; } private function onGPExecuteComplete(event:GeoprocessorEvent):void { gpPending = false; var parameterValue:ParameterValue = event.executeResult.results[0]; var fset:FeatureSet = FeatureSet(parameterValue.value); var feature:Graphic = fset.features[0]; var symbol:SimpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, 0xFF0000, 0.1); symbol.outline = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 0xFF0000, 1.0, 2); feature.symbol = symbol; } ]]> </fx:Script>
Francesco, Error#1009 is an Action Script error meaning you are trying to access an object or method that has not been put on the "stage" yet. Check out this site for more info:
I found that I got this error when I tried to search on water meters in our flex app. I found that in the original .mxd file that the service was built from, the ObjectID was not turned on, hence flex could not "see" the object, therefore the Error#1009. portangeles