Aldonline

Dynamically Binding to a Style in Flex

Problem

You need to bind a value to a style ( not a property ). This is not currently allowed, as the only way to set a style is through the setStyle( ) method,

Solution

Use the StyleBinding tag from BigFlexLib

<styles:StyleBinding 
    target="{myComponent}" 
    style="color" 
    value="{data.color}"
    />

As expected, this will internally call myComponent.setStyle('color', data.color) whenever data.color changes.