Skip navigation
Currently Being Moderated

Can you set a property in a SkinClass dynamically

Nov 29, 2013 7:33 AM

Hi,

Ive created my own class for for a button...

 

<s:Button label="1" height="150" width="150" skinClass="com.skin.LayoutBtnSelector"  />

 

 

In my LayoutBtnSelector I have added an image....

 

<s:Image id="anImage" source="assets/imgs/layoutSelectors/double.png" verticalAlign="middle" horizontalAlign="center"/>

 

 

This is all works fine but for each button I create I want to set that image Source... Is their a means to do that dynamically?

 

Thanks

Aidan

 
Replies
  • Currently Being Moderated
    Dec 3, 2013 9:05 AM   in reply to home_aidan

    Hello.

     

    You can use property "icon", for example.

    Something like that:

     

    <s:Image id="anImage" source="{hostComponent.getStyle('icon')}" verticalAlign="middle" horizontalAlign="center"/>

     

    or try to use skin part name of appropriate skin part

     

    <s:Image id="iconDisplay" verticalAlign="middle" horizontalAlign="center"/>

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points