Are you looking for the ToggleSwitch component? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/co mponents/ToggleSwitch.html
-Alex On 9/4/16, 1:50 PM, "scott matheson" <[email protected]> wrote: >Hi > i am making my own draggable switch, I was expectin g to set the >dragEnabled on the Button > > id=“indicatorButton” but this does not seem to be a propriety > > > >can you Drag buttons ? > >Scott > > > > ><fx:Script><![CDATA[ > private var _switch:Boolean = true; // true == locked > private var _ep:Event; > > public var locked:String; > public var unlocked:String; > > private function buttonClicked():void { > > if (_switch) { > _switch = false; > this.setCurrentState("offState"); > _ep = new Event("unlocked", true); // the name of the event >is the same as the Event = define above > this.dispatchEvent(_ep); > } else { > > _switch = true; > this.setCurrentState("onState"); > _ep = new Event("locked", true); // the name of the event is >the same as the Event = define above > this.dispatchEvent(_ep); > } > > } > ]]></fx:Script> > > ><s:states> > <s:State name="onState" /> > <s:State name="offState" /> > ></s:states> > > ><s:BorderContainer width="110" backgroundColor="0xc0c0c0" >cornerRadius="4" borderColor="0x515151" dragComplete="buttonClicked()"> > > <s:Label text="{unlocked}" fontSize="12" y="8" left="2" >color="0xf4f4f4" /> > <s:Label text="{locked}" fontSize="12" right="2" y="8" >color="0xf4f4f4" /> > <s:Button id="indicatorButton" width="50" height="99%" label="| | |" >color="black" fontSize="18" click="buttonClicked()" > left.onState="1" right.offState="1" cornerRadius="4" /> > ></s:BorderContainer> >
