Flash AS crit
Flash AS crit
Out of context: Reply #3
- Started
- Last post
- 4 Responses
- Anarchitect0
don't use onClip events. use intervals, you can override the framerate by changing its loop speed.
MovieClip.prototype.slidePos(mov... moveY, myEase) {
if ((Math.Abs(moveX-this._x) { 1) && (Math.Abs(moveY-this._y){1)) {
this._x = moveX;
this._y = moveY;
clearInterval(slideLoop);
} else {
this._x -= (this._x-moveX)*myEase;
this._y -= (this._y-moveY)*myEase;
}
}
}//30 is the interval in milliseconds, the bigger it is, the slower is the interval
MovieClip.prototype.slide(moveX, moveY, myEase){
clearInterval(this.slideLoop);
this.slideLoop=setInterval(this... moveX, moveY, myEase);
}//you can now use this in any MC with
// mc.slide(10,20,0.5);