Parabolic movement

hi everyone,

Can anybody tell me how to give a parabolic movement to a MovieClip

Thanks in Advance
Deepthi

Create your parabolic function, move the movie clip along the x axis at whatever speed you want and find the y value from it’s x position.

import flash.events.Event;

mc.x = 0
function move(evt:Event):void {
	//parabola with zeros at 0 and 550 and stretching to 200
	//negative because Flash's y axis is reversed
	mc.y = -0.002644 * Math.pow(((mc.x += 3) - 275), 2) + 200;	
}
mc.addEventListener(Event.ENTER_FRAME, move);

hi ,

Thanks a lot for the code snippet…But i was not able to run the code …my movie clip was not moving.

Could you please help me

Thanks

with regards

Deepthi

Just put a movie clip on the stage named mc.

or…

800x600 stage.
Place movieclip “mc” at 0, 0,
Move registration point to x:400, y:0

Example:[COLOR=“Blue”][U]http://www.byrographics.com/AS3/pendulum/pendulum.html[/U][/COLOR]

stop();
import gs.TweenMax;
import fl.motion.easing.*;

function forward():void {
	TweenMax.to(mc, 1.2, {rotation:-180, onComplete:reverse, ease:Cubic.easeInOut});
}

function reverse():void {
	TweenMax.to(mc, 1.2, {rotation:0, onComplete:forward, ease:Cubic.easeInOut});
}

forward();

But… [FONT=“Courier New”]mc.y = -0.002644 * Math.pow(((mc.x += 3) - 275), 2) + 200;[/FONT] is so much cooler!

Ya seriously.

Plus what you have isn’t parabolic.

TheCanadian’s advanced math is seriously cool. (and a little scary)

[COLOR=“Blue”][U]http://www.byrographics.com/AS3/parabolic/parabolic.html[/U][/COLOR]

stop();
import gs.TweenMax;
import fl.motion.easing.*;
import flash.events.Event;

//fake parabolic-orange dot
function forward():void {
	TweenMax.to(mc, 1.2, {x:550, y:0, bezierThrough:[{x:275, y:200}], onComplete:backward, ease:Quadratic.easeInOut});
}

function backward():void {
	TweenMax.to(mc, 1.2, {x:0, y:0, bezierThrough:[{x:275, y:200}], onComplete:forward, ease:Quadratic.easeInOut});
}

forward();

//true parabolic-blue dot
mc2.x = 0;
function move(evt:Event):void {
//parabola with zeros at 0 and 550 and stretching to 200
//negative because Flash's y axis is reversed
mc2.y = -0.002644 * Math.pow(((mc2.x += 3) - 275), 2) + 200;
}
mc2.addEventListener(Event.ENTER_FRAME, move);