PDA

View Full Version : How to make togglebuttonbar with image buttons?


jaimeker
06-25-2010, 04:14 PM
Hi, i am trying to make a toggle button bar with each button being identified by a image (an icon), the thing is, it does not look like I can add the image to each button correctly. Or it must be I did not find the right way.
I have no problem making a string button just as the flex sample provided

<mx:ToggleButtonBar itemClick="clickHandler(event);">
<mx:dataProvider>
<mx:Array>
<mx:String>Flash</mx:String>
<mx:String>Director</mx:String>
<mx:String>Dreamweaver</mx:String>
<mx:String>ColdFusion</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>

However when I tried to substitute the string part with image, it does not show at all.
Codes as below

<mx:ToggleButtonBar x="10" y="43" width="227" height="55" id="TgBtnBarGraphics">
<mx:dataProvider>
<mx:Array>
<mx:Image source="Embeded@('com/FCC/assets/images/Controls/i_draw_line.png')"></mx:Image>
<mx:Image source="Embeded@('com/FCC/assets/images/Controls/i_draw_point.png')"></mx:Image>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>

Any advice is appreciated !!!

drkstr
06-25-2010, 07:38 PM
Try using actual Button instances as your data provider. Skin and style the buttons with the images you want to use.