SNOWFLAKES DRAWING PAPER
[Flex] Setting an icon on a Spark Button in Flex Hero 본문
[Flex] Setting an icon on a Spark Button in Flex Hero
눈송2 2010. 12. 20. 17:43
http://blog.flexexamples.com/2010/12/17/setting-an-icon-on-a-spark-button-in-flex-hero/
Spark Button icon 설정
1)
...
<fx:Script>
<![CDATA[
[Embed("assets/test.png")]
protected const ICON:Class;
]]>
</fx:Script>
...
<s:Button label="Spark Button with dynamic icon" icon="assets/test.png"/>
<s:Button label="Spark Button with inline embedded icon" icon="@Embed('assets/test.png')"/>
<s:Button label="Spark Button with metadata [Embed] icon" icon="{ICON}"/>
...
2)
...
<fx:Script>
<![CDATA[
[Embed("assets/test.png")]
protected const ICON:Class;
]]>
</fx:Script>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
s|Button#btn1 {
icon:"assets/test.png";
}
s|Button#btn2 {
icon:Embed("assets/test.png");
}
s|Button#btn3 {
icocon:PropertyReference("ICON");
}
</fx:Style>
<s:Button label="Spark Button with dynamic icon:/>
<s:Button label="Spark Button with inline embedded icon"/>
<s:Button label="Spark Button with metadata [Embed] icon"/>
...
3)
...
<fx:Script>
<![CDATA[
[Embed("assets/test.png")]
protected const ICON:Class;
protected function init():void
{
btn1.setStyle("icon","assets/test.png");
btn2.setStyle("icon",ICON);
}
]]>
</fx:Script>
<s:Button label="Spark Button with dynamic icon:/>
<s:Button label="Spark Button with inline embedded icon"/>
<s:Button label="Spark Button with metadata [Embed] icon"/>
...
'개발 > FLEX/AS3/AIR/BlazeDS' 카테고리의 다른 글
[Flex] Creating a drop down DataGrid control in Flex 4 (0) | 2010.12.21 |
---|---|
[Flex] Setting explicit columns on a Spark DataGrid control in Flex Hero (0) | 2010.12.21 |
[AIR] Hacking AIR for Android 1/2: Getting device specific properties (0) | 2010.12.20 |
[AIR] AIRRuntime 2.5 File.resolvePath에서 제한된 상대경로 (0) | 2010.10.26 |
[AS3] Object 와 Array 명시적 테스트 (0) | 2010.10.06 |