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 1Create a new flash document, take the Oval Tool (O), and draw a sun like it is shown on the picture below!. Step 2Select 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 3Double click on Layer1 to rename its name into a sun. After that insert a new layer and name it Action. Step 4Click on the second frame of layer sun and press F5 on the keyborad. Step 5After that click on the first frame of layer action, open the Action Script Panel (F9) and paste this script: toggleHighQuality(); startDrag("/mxy", true); Step 6Click 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 7Go 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 8While 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!
|
Forum - Newest Discussions
Related links
|