<fx:Script>   <![CDATA[     [Bindable] var RBlabel:String;            // variable used to capture the current (identified) layer name    [Bindable] var RBlayer:String;           //variable used to tell which layer to toggle on/off    [Bindable] var RBonsel:Boolean = false;  // variable used to capture "selected" state of the radio button    [Bindable] var RBoffsel:Boolean = true;  // variable used to capture "selected" state of the radio button     private function skin_preinitializeHandler(event:FlexEvent):void    {     // set the link styles //My Add                      off.visible = false;     on.visible = false;     RBlayer = "";     RBlabel = "";          if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/Buildings/MapServer/3"){      off.visible = true;      on.visible = true;          RBlayer = "Buildings";      RBlabel = "Building Labels";     }     if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/1"){      off.visible = true;      on.visible = true;          RBlayer = "WasteSites";      RBlabel = "Point Labels";     }     if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/2"){      off.visible = true;      on.visible = true;          RBlayer = "WasteSites";      RBlabel = "Line Labels";     }     if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/3"){      off.visible = true;      on.visible = true;          RBlayer = "WasteSites";      RBlabel = "Poly Labels";     } //End My add     textLayoutConfiguration = new Configuration();     var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();     textLayoutFormat.color = getStyle("linkActiveColor")     textLayoutFormat.textDecoration = TextDecoration.UNDERLINE;     textLayoutConfiguration.defaultLinkActiveFormat = textLayoutFormat;      vGroup.addElement(ToggleLayers);   // My Add - this is not where I have it, just wanted to include it somewhere.   //My Add    protected function layerRBgroup_changeHandler(event:Event):void    {     var map:Map = hostComponent.map;     if (event.currentTarget.selectedValue == "on"){          map.getLayer(RBlabel).visible = true;       RBonsel = true;                                                 RBoffsel = false;      }     if (event.currentTarget.selectedValue == "off"){         map.getLayer(RBlabel).visible = false;         RBoffsel = true;                           RBonsel = false;           }    }    private function infoWinClose_Handler(event:Event):void    {            var map:Map = hostComponent.map;      map.getLayer(RBlabel).visible = false;      RBoffsel = true;      RBonsel = false;     }     }    //End My add   ]]>  </fx:Script>   <fx:Declarations>   <!--- @private -->   <s:RadioButtonGroup id="layerRBgroup" change="layerRBgroup_changeHandler(event)" />     <!--- @private -->   <s:HGroup gap="6" verticalAlign="middle" id="ToggleLayers">    <s:RadioButton id="on" value="on" group="{layerRBgroup}" label="Turn Labels On" selected="{RBonsel}" />    <s:RadioButton id="off" value="off" group="{layerRBgroup}" label="Turn Labels Off" selected="{RBoffsel}" />   </s:HGroup>  </fx:Declarations> </s:SparkSkin>Solved! Go to Solution.
