Hi there party people,
and non-party people as well. Today you are going to learn how to use code snippets, and how to make a simple switching program that uses buttons to go to scenes.
This project is going to have two parts. The first is just to practice the code, and the second is to have two endings.
The first part will have a button with a number 1 on it. Clicking the button will make animate play scene 2, which will just have a number 2 on it. There will be a restart button on scene 2 that will go to scene one There will be another button on the first scene labelled 2, and clicking it will make animate go to and play scene 3. Scene 3 will just have the number 2, and then it will go back to scene 1 after some time.
To use a code snippet, click on window and choose Code Snippets
Then Click on the ActionScript folder
Then Click on Timeline Navigation and we will use Stop at this Frame and Click to Go to Scene and Play. We will use stop at this frame to prevent Animate from going through all the scenes. We will make a button that moves around the timeline with Click to Go to Scene and Play.
OK. Let’s start the easy one. Create a new action Script 3.0 document and draw two shapes. Label them 1 and 2.
Now create a button with one of the shapes selected.
Then Add the code with code snippets. Make sure to change the highlighted number to 2 for one, and you can leave it on 3 for the other button.
Follow those two steps with the other button, remember that you can leave the scene on 3 for this second button.
Then go down the timeline a bit, make a keyframe and put the stop on this frame code snippet in.
Then make scenes 2 and 3, just with a number 1 on scene 2 and a number 2 on scene 3.
use the stop on this frame code for both scenes.
Last thing, make a restart button for both scene 2 and 3 that will take the user back to scene 1.
And you’re done!
hand it in as easy switch.
Now make a more complicated version with 2 little animated scenes. Hand that in as choice one.
You must be logged in to post a comment.