Bind icon to class : Icon « Graphics « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Graphics » IconScreenshots 
Bind icon to class
Bind icon to class
  
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

    <mx:Script>
        
            [Bindable]
            [Embed(source="a.png")]
            private var Icon:Class;
      
    </mx:Script>

    <mx:Button label="[Embed(source='a.png')]" icon="{Icon}" />
    <mx:Button label="@Embed('a.png')" icon="@Embed('a.png')" />

</mx:Application>

   
    
  
Related examples in the same category
1.Use iconFunction to determine the icon to displayUse iconFunction to determine the icon to display
2.Set the default leaf icon to null to hide it, and uses custom icons for the folder open and closed iconsSet the default leaf icon to null to hide it, and uses custom icons for the folder open and closed icons
3.Adding an icon to the buttonAdding an icon to the button
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.