<?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 Re: trying to get layer ID from a loadError event in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631952#M14058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a dynamic map service with ID of "editsLayer" that I created and instantiated&amp;nbsp; in actionscript as a module level variable.&amp;nbsp; I added an event listener to it:&amp;nbsp; editsLayer.addEventListener(LayerEvent.LOAD_ERROR, onMapServiceLoadError);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, in order to test the "onMapServiceLoadError" function, I stop the map service, run the app with a breakpoint in the below function.&amp;nbsp; I inspect the "event" object and nowhere in there is reference to the layer ID "editsLayer".&amp;nbsp; I only see the generic id "ArcGISDynamicMapServiceLayer22" as you noted.&amp;nbsp; In order to meaningfully have an Alert message such as the one below, I'd like to be able to see the actual ID of the layer that errored out and not the generic ID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function onMapServiceLoadError(event:LayerEvent) : void &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show("Failure loading Map Service:&amp;nbsp; " + event.layer.id ....);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jun 2010 13:47:45 GMT</pubDate>
    <dc:creator>RoyceSimpson</dc:creator>
    <dc:date>2010-06-17T13:47:45Z</dc:date>
    <item>
      <title>trying to get layer ID from a loadError event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631950#M14056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got a loadError event defined this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editsLayer.addEventListener(LayerEvent.LOAD_ERROR, onMapServiceLoadError);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like the onMapServiceLoadError function to be able to retrieve the name of the originating object, in this case "editsLayer", but what gets returned is "ArcGISDynamicMapServiceLayer22".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked over the event object (event.target..., event.layer...) and can't find any reference to "editsLayer" Id.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What concept am I missing here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 21:06:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631950#M14056</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-06-16T21:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get layer ID from a loadError event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631951#M14057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Royce,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Not sure what your exact situation is but normally when you see an id like "ArcGISDynamicMapServiceLayer22" that means that the API has to assign a generic name for you because one was not defined in code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 00:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631951#M14057</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-06-17T00:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get layer ID from a loadError event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631952#M14058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a dynamic map service with ID of "editsLayer" that I created and instantiated&amp;nbsp; in actionscript as a module level variable.&amp;nbsp; I added an event listener to it:&amp;nbsp; editsLayer.addEventListener(LayerEvent.LOAD_ERROR, onMapServiceLoadError);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, in order to test the "onMapServiceLoadError" function, I stop the map service, run the app with a breakpoint in the below function.&amp;nbsp; I inspect the "event" object and nowhere in there is reference to the layer ID "editsLayer".&amp;nbsp; I only see the generic id "ArcGISDynamicMapServiceLayer22" as you noted.&amp;nbsp; In order to meaningfully have an Alert message such as the one below, I'd like to be able to see the actual ID of the layer that errored out and not the generic ID.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function onMapServiceLoadError(event:LayerEvent) : void &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alert.show("Failure loading Map Service:&amp;nbsp; " + event.layer.id ....);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 13:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631952#M14058</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-06-17T13:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get layer ID from a loadError event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631953#M14059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you create a layer in ActionScript, it's id is initially null. You can set it or the API will set it to a generic value. In MXML the id is set for you by the MXML compiler.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 13:50:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631953#M14059</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-06-17T13:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: trying to get layer ID from a loadError event</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631954#M14060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When you create a layer in ActionScript, it's id is initially null. You can set it or the API will set it to a generic value. In MXML the id is set for you by the MXML compiler.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wow, ok, I've been at this for some time now and didn't realize that the ID and the variable name were not the same thing and that you have to expicitly set the ID separately from naming the variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will try that out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 13:59:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/trying-to-get-layer-id-from-a-loaderror-event/m-p/631954#M14060</guid>
      <dc:creator>RoyceSimpson</dc:creator>
      <dc:date>2010-06-17T13:59:26Z</dc:date>
    </item>
  </channel>
</rss>

