views:

400

answers:

1

Hello all I am trying to add different icon on different buttons. I have my skin file ready but not sure if I have to create different skin class for different button. It sounds inefficient. Any suggestions? Thanks for the reply...

<s:Button id="pass"
      width="110"
      height="35"
      fontWeight="bold" 
          fontSize="12" 
      fontFamily="arial" 
      label="Past Track" 
      click="pass_clickHandler(event)" skinClass="skins.CustomSkin"/>       
<s:Button id="future" 
      width="110"
      height="20"
      fontWeight="bold" 
      fontSize="12" 
      fontFamily="arial" 
      label="Future Plan"
          click="future_clickHandler(event)"
          skinClass="skins.CustomSkin"/>

Skin.....

   <!-- layer 2: fill -->
    <!--- @private -->
    <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="2">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="#304fd7" 
                             color.over="#4b6bf6" 
                             color.down="0xAAAAAA" 
                             alpha="0.85" />
            <s:GradientEntry color="#1f38a3" 
                             color.over="#3653cf" 
                             color.down="0x929496" 
                             alpha="0.85" />
        </s:LinearGradient>
    </s:fill>
</s:Rect>


<!-- icon --> // I could add my icon here but that would make me to create  
                  //different icon image for different button
+1  A: 

It is not built in, but a few folks have created components that support icons in Spark Buttons:

http://www.themorphicgroup.com/blog/2009/06/18/how-to-create-a-spark-icon-button-and-skin/

http://www.andymcintosh.com/?p=179

www.Flextras.com
Thanks for the post. +1
Jerry