Change MovieClip position
package {
import flash.display.MovieClip;
import flash.events.Event;
public class Motion extends MovieClip {
public function Motion() {
}
public function init(xVal:Number,yVal:Number):void {
this.x = xVal;
this.y = yVal;
addEventListener(Event.ENTER_FRAME, update);
}
private function updatePosition():void {
this.x++;
this.y++;
}
private function update(evtObj:Event):void {
this.updatePosition();
}
}
}
Related examples in the same category