Okay, this is driving me crazy. According to what I read, a queryTask.executeLastResult should return a FeatureSet. I should be able to then use myFeatureSet.features.length to find out how many features were returned . But it's not working. However, using the AsyncResponder with an onResult function, works fine.For example, this querytask using the Asyncresponder will process fine so I KNOW the querytask works with the queryFloodStudies query (but I can't use the asyncresponder for other reasons):cityfloodstudiesQueryTask.execute(queryFloodStudies, new AsyncResponder(onCityFloodResult, onCityFloodFault));
function onCityFloodResult(cityfloodfeatureSet:FeatureSet, token: Object=null):void
{
if(cityfloodfeatureSet.features.length == 0)
{
floodZonetext = "The Parcel doesn't touch a 100 or 500 yr Flood Zone" + "\n" + floodVerificationNote;
}
else // did find that parcel intersected a flood poly from the City Flood Studies
{
floodZonetext = "This parcel touches a Flood Hazard area";
} // end else
} //end onresult
But the below code will not. Compiles fine, but when running, it just hangs at the If statement. What am I missing? var cityfloodfeatureSet:FeatureSet;
cityfloodstudiesQueryTask.execute(queryFloodStudies);
cityfloodfeatureSet = cityfloodstudiesQueryTask.executeLastResult;
if (cityfloodfeatureSet.features.length == 0)
{
floodZonetext = "The Parcel doesn't touch a 100 or 500 yr Flood Zone" + "\n" + floodVerificationNote;
}
else // did find that parcel intersected a flood poly from the City Flood Studies
{
floodZonetext = "This parcel touches a flood hazard area";
}
OR if someone can tell me how to force Flex to WAIT for the AsyncResponder to finish before continuing with the code, that's would help. This query is nested within another QueryTask's onResult function. I hope it is something simple that I am missing. Thanks!