views:

21

answers:

1

I have a button with a click event of "currentState='someState'". Is there a way to tell component to do some function like for example "Function()" when the state changes to "someState"? So execute a function when the state is changed.

Thanks,

+1  A: 

You can do this in mxml when you define your state like so:

<mx:State name="someState" enterState="someFunction()"/>
Wade Mueller