<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Style> .styleA {color: #333399;} .styleB {text-decoration : underline;} </mx:Style> <mx:Script> <![CDATA[ private function creationCompleteHandler():void { Object(test.getChildAt(0)).setStyle("styleName", "styleA"); Object(test.getChildAt(2)).setStyle("styleName", "styleB"); } ]]> </mx:Script> <mx:ToggleButtonBar id="test" creationComplete="creationCompleteHandler();"> <mx:dataProvider> <mx:Array> <mx:String>AAA</mx:String> <mx:String>BBB</mx:String> <mx:String>CCC</mx:String> </mx:Array> </mx:dataProvider> </mx:ToggleButtonBar> </mx:Application>