Toxiclab.org

Frame jumping by action script

11.3.2008, 1:32
Submited in: Flash | Total Views: 72205

This simple tutorial will show you how to jump on any frame using a little action script code. You can apply this example for any flash site, when you need to jump somewhere. Let's go!



Step 1

Create a new flash document. Double click on layer 1 to rename its name in frame 1. After that, select the first frame of layer frame 1 and draw or import any object on that frame. After that, create a new layer above the layer frame 1 and name it frame 8. Then, click on frame 8 of layer frame 8 and press F6 key. While you're still on frame 8 of layer frame 8, draw again, or import any object. Now, we have two layers with the objects on the different frame (frame 1 and frame 8).See the picture below.





Step 2


Create a new layer above the layer frame 8 and name it buttons. After that, select the first frame of layer buttons, take the Text Tool (A) and type, "Go to frame 8". While the text is still selected, press F8 key (Convert to Symbol) to convert this text into a button.



Step 3

Take the Selection Tool (V) and click once on the new made button to select it. After that, go to the Action Script Panel (F9) and enter this code inside the actions panel:

on (release) {
gotoAndPlay(8);
}

Step 4

Take again the Selection Tool (V) and click once on the first frame of layer buttons. Then, go again to the A.S.panel (F9) and enter this code inside the actions panel:

stop();

Step 5

Click on frame 8 of layer buttons and press F7 key (Blank keyframe). After that, take again the Text Tool (A) and type "Go to frame 1". While the text is still selected, press again F8 key (Convert to Symbol) to convert this text into a button.

Step 6

Take the Selection Tool (V) and click once on the new made button to select it. After that, go to the Action Script Panel (F9) and enter this code inside the actions panel:

on (release) {
gotoAndPlay(1);
}

Step 7

Select now frame 8 and repeat step 4.

We're done!

Test your Movie and enjoy!

Download example

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category


Most popular tutorials