Select to view content in your preferred language

error #1009 with GP Service

606
1
11-23-2010 04:14 AM
francescodi_vito
Deactivated User
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>

and the declaration is

<fx:Declarations>
 
 
  <esri:Geoprocessor id="gp"
         executeComplete="onGPExecuteComplete(event)"
         outSpatialReference="{myMap.spatialReference}"
         showBusyCursor="true"
         url="http://vais-pc/ArcGIS/rest/services/query/GPServer/Model"
         useAMF="false"/>
</fx:Declarations>


now  when i run my application my browser give me a Error #1009!!!!
Help please.
thanks
Tags (2)
0 Kudos
1 Reply
City_of_Port_Angeles_GIS
Occasional Contributor
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:

http://curtismorley.com/2007/08/15/flash-cs3-flex-error-1009-cannot-access-a-property-or-method-of-a...

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
0 Kudos