Select to view content in your preferred language

Grouping features out from an Array, please help!

818
2
09-08-2010 12:26 AM
sidneykelvin
Emerging Contributor
Hello,

I have in hand an identifyResults Array. I want to extract all its features only to a new array "zoomFeatures" but failed.

Here are the part of the codes and error message extracted.
Hope someone could help!

Thanks in advance


private var zoomFeatures:Array;
private function identifyResultFunction(identifyResults:Array, clickGraphic:Graphic = null):void           
{               
if (identifyResults && identifyResults.length > 0)               
{  
          zoomFeatures.splice(0,zoomFeatures.length);
              for (var k:Number = 0 ; k < identifyResults.length ; k++)
              {
               var kResult:IdentifyResult = new IdentifyResult;
               kResult = identifyResults;
               zoomFeatures.push(kResult.feature);
                          }
             }
}

TypeError: Error #1009: ????????? Null ???????????????????????????
at GMP/identifyResultFunction()
at mx.rpc::AsyncResponder/result()
at com.esri.ags.tasks::IdentifyTask/handleDecodedObject()
at Function/http://adobe.com/AS3/2006/builtin::call()
at com.esri.ags.tasks::BaseTask/handleResult()
at Function/<anonymous>()
at mx.rpc::Responder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
Tags (2)
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Did you ever set the zoomFeature array to a new Array? Either

private var zoomFeatures:Array = new Array;

or

zoomFeatures = new Array();
0 Kudos
sidneykelvin
Emerging Contributor
It works !!!

Thank you very much for your help !
0 Kudos