A basic ActionScript command is the gotoAndPlay command that we have already seen many times in examples. This command jumps from the current frame to any frame you specify. You can use a number or a frame marker name. Here are some examples: gotoAndPlay(7);
gotoAndPlay(20);
gotoAndPlay("my frame label")
You can also specify a scene if your movie uses more than one. If you use gotoAndPlay with just one parameter, that parameter is the frame. But if you use it with two parameters, the first is the scene name and the second is the frame number or name. gotoAndPlay("My Scene","My Frame");
When you use the gotoAndPlay command, the movie jumps to the frame specified and immediately continues playing. However, if you want the movie to jump to another frame and stop on that frame, you should use the gotoAndStop command. It works the same way as gotoAndPlay, with the same option of using one or two parameters. There are also two simple commands that work just like gotoAndStop but take the movie to the next frame or the previous frame. You can use nextFrame or prevFrame in cases where you just want to advance or go back one frame. To see all these commands in action, it is useful to have a movie with buttons. So let's take a look at how to create buttons before going any further.
|
|||||||||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us or use the "Report this article" button on this page to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. |
|||||||||||||