Search Flex Components Free

Custom Search

March 16, 2008

Setting a Button control’s icon to an asset from a SWF file in Flex





The following example shows how you can set a Flex Button control's icon style to an asset from a SWF file using MXML or ActionScript.


Full code after the jump.


View MXML


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

layout="horizontal"

verticalAlign="middle"

backgroundColor="white">



<mx:Button label="Bullet Add"

icon="@Embed(source='icons.swf', symbol='bullet_add')" />

<mx:Button label="Bullet Delete"

icon="@Embed(source='icons.swf', symbol='bullet_delete')" />

<mx:Button label="Bullet Star"

icon="@Embed(source='icons.swf', symbol='bullet_star')" />



</mx:Application>

Related Flex Tutorials