I have the following MXML (this is not the complete file)
<s:states> <s:State name = "preCopy"/> <s:State name = "copyState" /> </s:states> <s:Panel title = "blah" id = "appPanel" > <s:VGroup id = "mainBox" includeIn = "preCopy"> <s:Button name = "Start Copy Now" click = "startCopyNow(event)" /> <s:Label id = "timeToCopyTxt" /> <s:Button name = "Stop Autostart" click="mouseStopAutostart(event)" /> <s:Button name = "Options" click="openOptions(event)"/> </s:VGroup> <s:VGroup includeIn="copyState"> <s:Label name="copying files"/> </s:VGroup> </s:Panel>
I want to know how to change states through actionscript because I want to change states through a timer Event and a mouse event.
You can change the state via the currentState property. For example:
currentState = "preCopy";
Thanks a lot. As a person more used to Actionscript, I am not used to using strings. I tried currentState = preCopy (note the lack of quotes) and obviously it didn't work....