This is what I went with, thanks to you both for your help!
private function addressQuery():void
{
graphicsLayerAddress.clear();
queryTaskAdd.execute(queryAdd, new AsyncResponder( onResult, onFault));
function onResult(featureSet:FeatureSet, token:Object = null):void
{
if (featureSet.features.length == 0)
{
Alert.show("Please try again.");
}
else
{
for each (var GraphicAddress:Graphic in featureSet.features)
{
GraphicAddress.toolTip = "High School: " + GraphicAddress.attributes.DISTHIGH + "\n" + "Middle School: "
+ GraphicAddress.attributes.DISTMIDDLE + "\n" + "Elementary School: " + GraphicAddress.attributes.DISTELEMEN + "\n" +
"Police District: " + GraphicAddress.attributes.PoliceDistricts + "\n" +
"Fire District: " + GraphicAddress.attributes.FireDistrict + "\n" +
"EMS Rescue: " + GraphicAddress.attributes.EMSRESCUE + "\n" +
"EMS Gems: " + GraphicAddress.attributes.EMSGEMS;
}
var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features);
if (featureSet.features.length == 1)
{
var gra:Graphic = GraphicAddress;
var pt:MapPoint = null;
pt = gra.geometry as MapPoint;
MainMap.scale = 1200;
MainMap.centerAt(pt);
}
else
{
MainMap.extent = graphicsExtent;
}
dpFlat.push(dataGridAddress.dataProvider.toString());
}
}
function onFault(info:Object, token:Object = null):void
{
Alert.show(info.toString());
}
}