Workshop
The quiz questions are designed to test your knowledge of the material covered in this hour. The answers to the questions follow.
Quiz Questions
If you have a movie with several frames, how do you prevent the movie from automatically animating through all the frames?
What is the difference between gotoAndPlay and gotoAndStop?
What are the two on handlers that will respond to a button click?
Why should you avoid using frame numbers in gotoAndStop and gotoAndPlay commands?
Quiz Answers
Place a stop command on the first frame.
The gotoAndPlay command jumps to a frame, and the movie continues to flow forward. The gotoAndStop command stops the movie on the destination frame.
You can use on (press) to trigger code when the user clicks the button and on (release) to trigger code when the user releases the button.
If you use frame numbers, and later insert or remove frames from your timeline, you will have to go back and adjust the frame numbers in your code. On the other hand, if you use frame names, your code will always go to the right frame.