private function getFeatureSet():FeatureSet { var gp:ArrayCollection = myLayer.graphicProvider as ArrayCollection; if (!gp) { return null; } var featureSet:FeatureSet = new FeatureSet(gp.toArray()); var counter:int; // for each feature in collection for each (var feature:Object in featureSet.attributes) { counter++; trace("> " + counter); // for each attribute in feature for (var attributeName:Object in feature) { var attributeValue:Object = feature[attributeName]; trace(">>> " + attributeName + " : " + attributeValue); } } return featureSet; } /* output */ /* > 1 >>> UNITS10_49 : 10898 >>> STATE_FIPS : 02 >>> AMERI_ES : 14569 >>> UNITS3_9 : 18983 >>> WIDOWED : 4428 >>> STATE_CITY : 0203000 >>> ASIAN_PI : 10910 >>> STATE_NAME : Alaska >>> DIVORCED : 20631 >>> AGE_5_17 : 45189 >>> RENTER_OCC : 39030 >>> AGE_18_64 : 151392 >>> HSEHLD_1_M : 10673 >>> AGE_65_UP : 8258 >>> TYPE : city ...*/
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.