The contents of my TOCWidget.xml now read:<configuration>
<labels>
<visibilitylabel>Layer Visibility</visibilitylabel>
<zoomtoextent>Zoom To Layer Extent</zoomtoextent>
<expandall>Expand All Layers</expandall>
<collapseall>Collapse All Layers</collapseall>
<zoomtomakevisible>Zoom To Make Visible</zoomtomakevisible>
<generatinglegendmsg>Generating TOC Legend</generatinglegendmsg>
</labels>
<tocsettings>
<expanded everything="false">false</expanded>
<collapselegends>true</collapselegends>
<disablezoomtomenuoption>true</disablezoomtomenuoption>
</tocsettings>
<legendtimeout>10</legendtimeout>
<excludelayers>
<excludelayer url="http://maps.myserver.com/mapstest/rest/services/Project/Test/MapServer" id="1"/>
</excludelayers>
<excludegraphiclayers>true</excludegraphiclayers>
<excludebasemaplayers>true</excludebasemaplayers>
<usenewesridescription>false</usenewesridescription>
</configuration>
I also tried<excludelayer mapservice="Layers">1</excludelayer>
With both configurations, Layer 1 from my map service is still showing p in the TOC. More significantly, the FeatureLayer that is created from MapService Layer 1 in AS & added to the map (via a separate custom widget) is showing up in the TOC as "FeatureLayer774". Then, when I remove that FeatureLayer from the map via AS, the TOC throws an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.TOC.toc.tocClasses::TocMapLayerItem/filterOutSubLayer()
at widgets.TOC.toc.tocClasses::TocMapLayerItem/processLegend()
at Function/<anonymous>()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
Is there something obvious I'm missing?