<?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 Bug in LegendSkin.mxml in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/bug-in-legendskin-mxml/m-p/528325#M11967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we had problems with the &lt;/SPAN&gt;&lt;STRONG&gt;legend&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using the ArcGIS for Flex v3.2 (build date 2013-03-19)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After some code inspections, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we identified the problem in this part of the code (LegendSkin.mxml lines 631..637):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if (layerInfos&lt;I&gt;.parentLayerId != -1){
&amp;nbsp;&amp;nbsp;&amp;nbsp; // find the parent and check its default visibility
&amp;nbsp;&amp;nbsp;&amp;nbsp; var parentLayerInfo:LayerInfo = findLayerById(layerInfos[0].parentLayerId, layerInfos);
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfos&lt;I&gt;.defaultVisibility = parentLayerInfo.defaultVisibility;
}
leafLayerLegendInfo.visible = layerInfos&lt;I&gt;.defaultVisibility;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We got it working after replacing the code in the line 634 :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;findLayerById(layerInfos[0].parentLayerId, layerInfos);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;findLayerById(layerInfos&lt;I&gt;.parentLayerId, layerInfos);&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug in the current 'LegendSkin.mxml' code provided with the API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Apr 2013 12:08:27 GMT</pubDate>
    <dc:creator>TomSchuller</dc:creator>
    <dc:date>2013-04-16T12:08:27Z</dc:date>
    <item>
      <title>Bug in LegendSkin.mxml</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/bug-in-legendskin-mxml/m-p/528325#M11967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we had problems with the &lt;/SPAN&gt;&lt;STRONG&gt;legend&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using the ArcGIS for Flex v3.2 (build date 2013-03-19)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After some code inspections, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;we identified the problem in this part of the code (LegendSkin.mxml lines 631..637):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if (layerInfos&lt;I&gt;.parentLayerId != -1){
&amp;nbsp;&amp;nbsp;&amp;nbsp; // find the parent and check its default visibility
&amp;nbsp;&amp;nbsp;&amp;nbsp; var parentLayerInfo:LayerInfo = findLayerById(layerInfos[0].parentLayerId, layerInfos);
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfos&lt;I&gt;.defaultVisibility = parentLayerInfo.defaultVisibility;
}
leafLayerLegendInfo.visible = layerInfos&lt;I&gt;.defaultVisibility;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We got it working after replacing the code in the line 634 :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;findLayerById(layerInfos[0].parentLayerId, layerInfos);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;findLayerById(layerInfos&lt;I&gt;.parentLayerId, layerInfos);&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a bug in the current 'LegendSkin.mxml' code provided with the API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 12:08:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/bug-in-legendskin-mxml/m-p/528325#M11967</guid>
      <dc:creator>TomSchuller</dc:creator>
      <dc:date>2013-04-16T12:08:27Z</dc:date>
    </item>
  </channel>
</rss>

