Wilfred
Wilfred

Reputation: 13

Changing state specific mxml parts in AS3

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.

Upvotes: 1

Views: 533

Answers (1)

Dunaril
Dunaril

Reputation: 2795

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}"

Upvotes: 1

Related Questions