Draw a ball.
Choose "Convert to Symbol" and Create a MovieClip .
Instance Name: ball_mc
Write the Following Actions Script [ Press F9 to open the Action Script Panel ]
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(ball_mc,"_y",Bounce.easeOut,ball_mc._y, 280,3,true);
For Details : Flash 8 Bouncing Ball Animation
Result:
Another code to create play button to play the animation :
import mx.transitions.Tween;
import mx.transitions.easing.*;
// new Tween(obj, prop, func , begin, finish, duration, useSeconds )
var temp:Tween = new Tween(ball_mc,"_y",Bounce.easeOut,ball_mc._y, 280,3,true);
this.play_mc.onRelease = function():Void
{
temp.start();
}
No comments:
Post a Comment