Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 Knowledgebase
Ease To A New Mouse Position  

How to create a simple quadratic easein tween.

Actionscript
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}

onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
}

onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

Note: Press the "refresh" button in the browser to play the animation again.


// As the actionscript is put inside the mc, "this" refers the the mc on the timeline the code is in.
// So by association references the the mc "mc1" as it is inside it.


onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}


© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us