|
|
Search Tutorials
1. Create a movie clip of a ball2. Drag an instance of it to the stage and name the instance "ball"3. Create a new layer and name this "actions"4. Add the following script to first frame of the actions layerfunction xcoord(vi,time){return vi*Math.cos(80*3.14/180)*time;}function ycoord(vi,time){return vi*Math.sin(80*3.14/180)*t-0.5*t*t;}initx=30;inity=400;v=30;t=0;n=0;r=0;ball.onEnterFrame=function(){t++;n++;ball._x=initx+xcoord(v,t);ball._y=inity-ycoord(v,t);ball._rotation=t*30;duplicateMovieClip(ball,"newball"+n,n);eval("newball"+n)._alpha=ball._alpha/10;if (ball._y>inity){initx=ball._x;t=0;v*=0.7;}if (ball._x>=300){removeMovieClip("newball"+r);r++;}}
|
||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||
|