LetsFlex

Icons / Images on a ToggleButtonBar

by jlagunas on Jun.11, 2008, under Skinning

The following example shows you how to apply an image as an icon to a ToggleButtonBar for each button.


<?xml version="1.0" encoding="utf-8"?>
		<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="0" backgroundColor="0x000000" viewSourceURL="srcview/index.html">
		<mx:Style>
			ToggleButtonBar
			{
				button-style-name: "buttons";
			}
			.buttons
			{
				padding-bottom: 10px;
				padding-left: 10px;
				padding-right: 10px;
				padding-top: 10px;
			}
		</mx:Style>
		<mx:Array id="menuArray">
			<mx:Object label="Macbook White" icon="@Embed(source='assets/macbook-white.png')" />
			<mx:Object label="Macbook Black" icon="@Embed(source='assets/macbook-black.png')" />
			<mx:Object label="Macbook Pro" icon="@Embed(source='assets/macbook-pro.png')" />
			<mx:Object label="Macbook Air" icon="@Embed(source='assets/macbook-air.png')" />
		</mx:Array>
		<mx:ToggleButtonBar id="menu" horizontalCenter="0" verticalCenter="0" width="500" dataProvider="{menuArray}" buttonMode="true" />
	</mx:Application>
:, , ,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...