Sunday, November 30, 2008

Flex Actionscript and MXML sleeping together

Loads of tutorials online provide means to control the look and feel of Flex GUI components. Majority of them use MXML to achieve this.

So what if you wanted to control the style in Action Script?

well call the "setStyle" method on the object.

Look at the API for a listing of MXML properties, e,g

mx:Label
Properties
condenseWhite="true|false"
data="null"
htmlText=""
listData="null"
selectable="true|false"
text=""
truncateToFit="true|false"

- example

then call {object}.setStyle("data","null")

No comments:

Post a Comment