Monday, December 28, 2009

How to show a different stage in ActionScript 3?

Hi all, just a quickie this time. I'd like to know what AS3 code I can execute in order to swap between stages in CS4. I'm assuming that a ';stage'; in Flash is similar to a ';Form'; in VB / .NET, where I could move from one form to another by throwing something like:





form2.show


form1.hide





Is there a similar method that I can use in AS3 to swap between stages? ThanksHow to show a different stage in ActionScript 3?
Not quite...





The stage is the area that you can draw on and that can be seen by the person who is watching the movie.





You draw on the stage, put movieclips on the stage, etc.





What you are looking for is FRAMES.





To compare to a VB app, lets say that your vb app has button1 on form1 and button2 on form2. To switch when they click the button, inside the button click code for button1 you would put:


form1.hide


form2.show





The flash equivalent would be to have two frames on the main timeline.


You would create an event handler for the clicking of button1. (you can look that up, I'm not explaining it because it wasn't part of your question, so I don't know if you understand event handlers or not!)





Inside the code for it, you would put:





MovieClip(root).gotoAndStop(2);





hope that helps and sorry for my rushed grammar and sentence structure, I have to go out the door atm


-Anon

No comments:

Post a Comment