Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 Knowledgebase
Simple Horizontal Motion Tween  

Download this .fla

How to create a simple horizontal motion tween.

Actionscript

onClipEvent (enterFrame) {
this._x += 10;
}


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(enterFrame){
this._x += 10;
}


// The code " _x +=10; " adds 10 pixels to the x position of the movie clip. as this is inside the "onClipEvent(enterFrame)"
// function it is called every time the animation enters a new frame.
// The code as a whole tells the movie clip it is inside the move 10 pixels to the right every time the animation enters
// a new frame.

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