Changing state specific mxml parts in AS3

539 views Asked by At

I'm using something like this in my MXML file:

<s:label id='mxml_label' text.state1='test' text.state2='test 2' />

Now i would like to change the state1 text from as3 on runtime.

Anyone any suggestions?

thx.

1

There are 1 answers

8
Dunaril On BEST ANSWER

You could bind the text for state1 to a bindable string variable that you will then update whenever you want.

[Bindable] private var state1TextString:String = "test";

Then your expression becomes :

text.state1="{state1TextString}"