Flashvault.net

Sunlight

14.8.2006, 21:24    Total views: 51758
The effects are everywhere. You can see it on flash header, intro, flash animation, flash menu....everywhere. Exactly that's the reason why I would teach you how to create special and advanced sunlight effect using Action Script.



Step 1

Create a new flash document, take the Oval Tool (O), and draw a sun like it is shown on the picture below!.



Step 2

Select the "sun" (Ctrl+A), and press F8 on the keyboard (Convert to Symbol) to convert it into a Movie Clip. Look at the picture below!



Step 3

Double click on Layer1 to rename its name into a sun. After that insert a new layer and name it Action.



Step 4

Click on the second frame of layer sun and press F5 on the keyborad.

Step 5

After that click on the first frame of layer action, open the Action Script Panel (F9) and paste this script:

toggleHighQuality();
startDrag("/mxy", true);

Step 6

Click on the second frame of layer action and press F6 on the keyboard. Then, while you're still on the second frame, paste in your Action Script Panel this script:

stop();

Step 7

Go back on the first frame of layer sun and double click on the "sun" (Movie Clip) or choose right click and Edit in Place. Look at the picture below!



Step 8

While your "sun" is still selected press again F8 on the keyborad (Convert to Symbol) to convert it again into a Movie Clip. After that, open the Properties Panel (Ctrl+F3) and under type sunshine. Look at the picture below!





Step 9

Double click again on the new made Movie Clip (sun) , or choose again right click and Edit in Place.





Step 10

While your "sun" is still selected, press again F8 on the keyboard to convert it into a Movie Clip. After that in the Properties Panel under type again sunshine, like we have done in step 8. Look at the picture below!





Step 11

Click on the tenth frame and press F6. After that take the Free Transform Tool (Q) and increase your "sun" a little.

#ads#

Step 12

Go back on the first frame, open the Properties Panel (Ctrl+F3) and under Tween choose Motion.





Step 13

Click on the twentieth frame and press F6. After that go back on tenth frame, and in the Properties Panel set the options from the picture below!



Step 14

Repeat the steps 11,12,13 couple times.

Step 15

Go back on the previous scene, insert a new layer and name it action.



Step 16

Click on the second, third, and fourth frame of layer action and press F6 (keyframe). Look at the picture below!



Step 17

Go back on the first frame of layer action, open the Action Script Panel (F9), and paste this script:

maxlight = "30";
dxstep = "0.09";
dx = "0.9";
setProperty("sunshine", _visible, "0");

Step 18

Click on the second frame and paste this script:

i = "1";
while (Number(i)<=Number(maxlight)) {
 duplicateMovieClip("sunshine", "li" add i, i);
 setProperty("li" add i, _xscale, getProperty("li" add (i-1),_xscale)+i*0.3);
 setProperty("li" add i, _yscale, getProperty("li" add (i-1),_yscale)+i*0.3);
 setProperty("li" add i, _alpha, 10-i*(10/50));
 setProperty("li" add i, _x, getProperty("li" add (i-1),_x)+i*dx);
 i = Number(i)+1;
}

Step 19

Click on the third frame and paste this script:

dx = dx-dxstep;
if (Number(dx)>0.9 or Number(dx) dxstep = -dxstep;
}
i = 1;
while (Number(i)<=Number(maxlight)) {
 setProperty("li" add i, _x, getProperty("li" add (i-1),_x)+i*dx);
 setProperty("li" add i, _y, getProperty("li" add (i-1),_y)+i*dx/20);
 i = Number(i)+1;
}

Step 20

Click on the fourth frame and paste this script:

gotoAndPlay(_currentframe-1);

Step 21

Click on the fourth frame of layer1, and press F5. Look at the picture below!



Step 22

Go back on the main scene and set the Frame rate to 120fps (Frames per Scond).

Test your Movie (Ctrl+Enter).

We're done!
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