MovieClip.prototype.addSlideTo = function (tx, ty, speed) { this._movespeed = (speed != undefined) ? speed : 4; this._targetX = tx; this._targetY = ty; this.attachEvent(_slideTo); } MovieClip.prototype.addScaleTo = function (tx, ty, speed) { this._scalespeed = (speed != undefined) ? speed : 4; this._targetScaleX = tx; this._targetScaleY = ty; this.attachEvent(_scaleTo); } MovieClip.prototype.addColorTo = function (tcolor, speed) { if (!this._color) { this._color = new Color(this); } var colorTransform = this._color.getTransform() this._colorspeed = (speed != undefined) ? speed : 4; this._targetColor = new Array((tcolor>>16)&255, (tcolor>>8)&255, tcolor&255); this._colorpercent = 0; this._color.setTransform(colorTransform); this.attachEvent(_colorTo); } MovieClip.prototype.addResizeTo = function (tw, th, speed) { this._resizepeed = (speed != undefined) ? speed : 4; this._targetWidth = tw; this._targetHeight = th; this.attachEvent(_resizeTo); } MovieClip.prototype.addAlphaTo = function (ta, speed) { this._alphaspeed = (speed != undefined) ? speed : 4; this._alphaa = this._alpha; this._targetAlpha = ta; this.attachEvent(_alphaTo); } /* Slides to MovieClip to position */ function _slideTo() { this._x += (this._targetX-this._x) / this._movespeed; this._y += (this._targetY-this._y) / this._movespeed; if (Math.abs(this._targetX-this._x)<0.2 && Math.abs(this._targetY-this._y)<0.2){ this._x = this._targetX; this._y = this._targetY; delete this._movespeed; delete this._targetX; delete this._targetY; this.detachEvent(arguments.callee); } } /* Don't use it with _resizeTo Scales the MovieClip */ function _scaleTo() { this._xscale += (this._targetScaleX-this._xscale) / this._scalespeed; this._yscale += (this._targetScaleY-this._yscale) / this._scalespeed; if (Math.abs(this._targetScaleX-this._xscale)<0.2 && Math.abs(this._targetScaleY-this._yscale)<0.2){ this._xscale = this._targetScaleX; this._yscale = this._targetScaleY; delete this._scalespeed; delete this._targetScaleX; delete this._targetScaleY; this.detachEvent(arguments.callee); } } /* Colors the MovieClip */ function _colorTo() { var colorTransform = this._color.getTransform(); var colors = new Array("r", "g", "b"); var matches = 0; for (var i=0; i