Thank you for replying my thread again, Really appreciate your time. I think I got some ideas but still unclear on some part.
Even though there are in separate group layer? I added the code your mention to my init function on TOCWidget.mxml
Can you change to specific layer id for sublayer A (i.e. layerlist[10])?
Code 1:
//new add -----------------
var layerlist:ArrayCollection = map.layers as ArrayCollection;
for (var j:int = 0; j < layerlist.length; j++)
{
if (toc.basemapLayers.getItemIndex(layerlist.id) == -1)
{
layerlist.addEventListener(FlexEvent.SHOW, mapLayerAddHandler2, false, 0, true);
}
}
//end new add ----------------------
code 2:
private function mapLayerAddHandler2():void
{
//Try to turn off sublayer B if sublayer A is being turn off
}