Tutorial 1 : Basic Actionscript
In flash, we will insert Actionscript either in a frame in a Timeline or behind a button.
a) If we insert an Actionscript in a frame, the timeline will look like this.
b) If we insert an Actionscript behind a button, we cannot see any changes on the Timeline and stage.
Actionscript - stop
How to stop Scene 1 from running?
1. Open class activity2.fla file
2. Activate Scene 1.
3. Add a new layer on top of all layers in Scene 1. Rename it as action.
4. Right click on any frame in the new layer and choose Action.
5. When the action window is opened, click at Add icon (+) and choose Global Functions > Timeline Control > Stop
6. Close the action window > Test movie.
(If your Scene 1 consists of animation, you can't see it anymore. This is because; the stop action is in frame 1. Therefore to make sure that you still can see the animation in Scene 1, you have to move the stop action from frame 1 in action layer to the last frame)
7. Click at frame 1 in action layer.
8. Holf Shift key and drag the first frame of action layer to the last frame.
9. Save your file > Add the stop action in all of your scenes if required.
Actionscript - gotoAndPlay
1. Add a new layer above action layer. Rename it as button.
2.Open button library through window > Common libraries > Buttons.
3. Double click classic buttons and Playback.
4. Drag gelRight button to the stage in layer button.
5. Click at the button on stage and right click to open action window.
6. Click at Add icon (+) and choose Global Functions > Movie Clip Control > On
7. Then choose release.
8. Move the blinking cursor in {symbol and click Add > Global Functions > Timeline Control > gotoAndPlay
9. In a bracket type the name of the scene you want to jump "Scene 2".
10. Save your file > Test the movie. Add button more in the following scene if required.
In flash, we will insert Actionscript either in a frame in a Timeline or behind a button.
a) If we insert an Actionscript in a frame, the timeline will look like this.
b) If we insert an Actionscript behind a button, we cannot see any changes on the Timeline and stage.
Actionscript - stop
How to stop Scene 1 from running?
1. Open class activity2.fla file
2. Activate Scene 1.
3. Add a new layer on top of all layers in Scene 1. Rename it as action.
4. Right click on any frame in the new layer and choose Action.
5. When the action window is opened, click at Add icon (+) and choose Global Functions > Timeline Control > Stop
6. Close the action window > Test movie.
(If your Scene 1 consists of animation, you can't see it anymore. This is because; the stop action is in frame 1. Therefore to make sure that you still can see the animation in Scene 1, you have to move the stop action from frame 1 in action layer to the last frame)
7. Click at frame 1 in action layer.
8. Holf Shift key and drag the first frame of action layer to the last frame.
9. Save your file > Add the stop action in all of your scenes if required.
Actionscript - gotoAndPlay
1. Add a new layer above action layer. Rename it as button.
2.Open button library through window > Common libraries > Buttons.
3. Double click classic buttons and Playback.
4. Drag gelRight button to the stage in layer button.
5. Click at the button on stage and right click to open action window.
6. Click at Add icon (+) and choose Global Functions > Movie Clip Control > On
7. Then choose release.
8. Move the blinking cursor in {symbol and click Add > Global Functions > Timeline Control > gotoAndPlay
9. In a bracket type the name of the scene you want to jump "Scene 2".
10. Save your file > Test the movie. Add button more in the following scene if required.
No comments:
Post a Comment