Flashvault.net

Timer

18.8.2006, 3:48    Total views: 49288

Learn how to create a timer in flash 8 using the action script. You can use it for picture presentation, slide show or something. 



Step 1

Create a new flash document and click twice on layer 1 to rename its name into a pictures.

Step 2

Click on the first frame of layer pictures, press Ctrl+R on the keyborad (Imoport to Stage) and Import any picture.



Step 3

After that click on the fifth frame and press F7 (blank keyframe).



Step 4

While you're still on the fifth frame, press again Ctrl+R on the keyboard (Import to Stage), and import another picture.

Step 5

After that, click again on the fifth frame, open the Action Script Panel (F9), and paste this script:

stop();

Step 6

Insert a new layer and name it action.

Step 7

Click on the second, third and fourth frame of layer action and press F6 on the keyborad (Keyframe).



Step 8

Go back on the second frame, open the Action Script Panel (F9), and paste this script:

currently = getTimer();
end = currently + 2000;

Step 9

Click on the third frame, and paste this script:

currently= getTimer();

Step 10

Click on the fourth frame, and paste this script:

if (currently <= end) {
gotoAndPlay (3);
}


We're done!

Test your movie (Ctrl+Enter), and you'll see that your second picture will appear 3 seconds after first picture (like slide show).

Bye!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Forum - Newest Discussions

Convert AVI Video to Flash
Last post by: linddy
Date: 29.11.2008 04:40:55

photogallery
Last post by: trnghosn
Date: 26.11.2008 16:22:19

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:01:33

For Sale Brand NewHTC Touch HD $380Samsung i900 Om
Last post by: so100
Date: 25.11.2008 13:00:48

Waiting for your hour of triumph? It is near!
Last post by: VitaMary
Date: 21.11.2008 18:46:41

Yeow dogs!
Last post by: deco11
Date: 21.11.2008 01:15:49

Show your girlfriend what a real sex is!
Last post by: VitaMary
Date: 20.11.2008 22:00:13

Regarding the Gradient by Mouse Tutorial...
Last post by: cloudy-days
Date: 19.11.2008 07:41:03

Open flash cs3 fla in flash 8???
Last post by: benjezza
Date: 14.11.2008 23:41:46

Related links