<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to access graphic.attributes in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-access-graphic-attributes/m-p/519890#M11798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What am I doing wrong here. I am just playing with a sample, trying to extend it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;txtNeighborhood.text = String(myGraphicsLayer.numGraphics);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i:int=0; i&amp;lt;myGraphicsLayer.numGraphics; i++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mygraphic:Graphic = myGraphicsLayer.graphicProvider&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtNeighborhood.text =&amp;nbsp;&amp;nbsp; txtNeighborhood.text + "," + &lt;/SPAN&gt;&lt;STRONG&gt;mygraphic.attributes["OBJECTID"];&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This line does not return the value of the attribute for the graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the sample that I am using.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jul 2011 17:04:24 GMT</pubDate>
    <dc:creator>Vinay_KumarVasa</dc:creator>
    <dc:date>2011-07-29T17:04:24Z</dc:date>
    <item>
      <title>Trying to access graphic.attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-access-graphic-attributes/m-p/519890#M11798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What am I doing wrong here. I am just playing with a sample, trying to extend it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;txtNeighborhood.text = String(myGraphicsLayer.numGraphics);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i:int=0; i&amp;lt;myGraphicsLayer.numGraphics; i++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mygraphic:Graphic = myGraphicsLayer.graphicProvider&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtNeighborhood.text =&amp;nbsp;&amp;nbsp; txtNeighborhood.text + "," + &lt;/SPAN&gt;&lt;STRONG&gt;mygraphic.attributes["OBJECTID"];&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This line does not return the value of the attribute for the graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the sample that I am using.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 17:04:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-access-graphic-attributes/m-p/519890#M11798</guid>
      <dc:creator>Vinay_KumarVasa</dc:creator>
      <dc:date>2011-07-29T17:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to access graphic.attributes</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-access-graphic-attributes/m-p/519891#M11799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I looked over the code.&amp;nbsp; I think the problem you are having is that the feature gets added to the same graphics layer as the drawn graphic, so you will have a mix of drawn graphics and feature graphics.&amp;nbsp; Your examining the drawn graphic, which has no attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would create a separate graphics layer, like &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:GraphicsLayer id="myParcelGraphicsLayer"/&amp;gt; in the map and then reference it at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function onResult(featureSet:FeatureSet, token:Object = null):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (featureSet.features.length &amp;gt; 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for each (var myGraphic:Graphic in featureSet.features)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; myParcelGraphicsLayer.add(myGraphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and in your AssignNeighborhood section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It should work then.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 22:01:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-access-graphic-attributes/m-p/519891#M11799</guid>
      <dc:creator>BenFerguson</dc:creator>
      <dc:date>2011-07-29T22:01:00Z</dc:date>
    </item>
  </channel>
</rss>

