Flash Script – 3D Perspective Moving Effect

type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/3deffect.swf'
width = '400'
height = '400'
bgcolor = 'black'

Many Flashers asked me how to create a 3d perspective effect, so here it is! Download the sample files here.

1. Create a grid using the line tool:


Convert this to a graphic object.

3. Make a duplicate of the graphic, and mirror it as shown below:


4.Create a line as shown below.


Convert this to a movie clip.

5. Give this movie clip an instance name of line.

6. Go to the timeline of the line movieclip, and create three keyframes as shown below.


7. In the first keyframe, insert the action:

y = /:initpos 
incr = 1;

8. In the second keyframe, insert:

setProperty ("", _y, y); 
y = y+incr;
incr = incr + .2;

9. In the third keyframe, insert the action:

gotoAndPlay (2);

10.Go back to the main time line, create two layers above the existing layer, and name them as shown below.


Make sure that the line movieclip is in the line layer.

11.Select the 8th frame of all the layers, and press f5. This will extend the frame to the 8th.

12. Go to the actions layer and in the first frame, insert the action:

initpos = getProperty("/line",_y); 
y = initpos;
incr = 1;
18.In the second frame give action:
duplicateMovieClip ( "/line","line" add incr, incr);
incr = incr + 1;
if((getProperty("/line" add incr,_y)) > 400)
removeMovieClip ("/line" add incr);

13. In the last frame, inser the action:

gotoAndPlay (2);

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments

Comments on this post are closed.