/* TYPES linearTween, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInSine, easeOutSine, easeInOutSine, easeInExpo, easeOutExpo, easeInOutExpo, easeInCirc, easeOutCirc, easeInOutCirc, easeInElastic, easeOutElastic, easeInOutElastic, easeInBack, easeOutBack, easeInOutBack, easeInBounce, easeOutBounce, easeInOutBounce, */ MovieClip.prototype.transform = function (setObj, endObj, onDone, onDoneParam, onDoneTarget ) { this.createEmptyMovieClip ("$_e", 123456); this.$_e.$_t = new Object (); this.$_e.$_t.delta = new Object (); this.$_e.$_t.start = new Object (); this.$_e.$_t.type = new Object (); this.$_e.$_t.type.$_d = (Math [setObj.type] == undefined) ? "linearTween" : setObj.type; this.$_e.$_t.end = endObj; this.$_e.$_t.ext1 = setObj.ext1; this.$_e.$_t.ext2 = setObj.ext2; this.$_e.$_t.now = 0; if (setObj.time != undefined) { this.$_e.$_t.mod = true; this.$_e.$_t.begin = getTimer (); this.$_e.$_t.duration = setObj.time * 1000; } else { this.$_e.$_t.mod = false; this.$_e.$_t.duration = (setObj.frames == undefined) ? 24 : setObj.frames; } this.$_e.$_t.onDone = onDone; this.$_e.$_t.onDoneParam = onDoneParam; this.$_e.$_t.onDoneTarget = onDoneTarget; //remember for (var prop in this.$_e.$_t.end) { if (typeof (this[prop]) == "number") { this.$_e.$_t.start [prop] = this [prop]; if (this.$_e.$_t.end [prop] instanceof Array ) { this.$_e.$_t.type [prop] = this.$_e.$_t.end [prop][1]; this.$_e.$_t.end [prop] = this.$_e.$_t.end [prop][0]; } this.$_e.$_t.delta [prop] = this.$_e.$_t.end [prop] - this [prop]; } } this.$_e.$_t.onEnterFrame = function () { if (this.$_t.now < this.$_t.duration) { this.$_t.now = (this.$_t.mod) ? getTimer () - this.$_t.begin : this.$_t.now + 1; for (var prop in this.$_t.end) { var type = (this.$_t.type [prop] != undefined) ? this.$_t.type [prop] : this.$_t.type.$_d; this._parent [prop] = Math [type](this.$_t.now, this.$_t.start [prop] , this.$_t.delta [prop] , this.$_t.duration, this.$_t.ext1, this.$_t.ext2); } } else { var onDone = this.$_t.onDone; var onDoneParam = this.$_t.onDoneParam; var onDoneTarget = this.$_t.onDoneTarget; delete (this.$_t); delete (this.onEnterFrame); this.removeMovieClip (); onDone.apply (((onDoneTarget == undefined) ? this._parent : onDoneTarget ) , onDoneParam); } } //transform if (setObj.delay != undefined) { function () { this.$_e.onEnterFrame = this.$_e.$_t.onEnterFrame; this.$_e.$_t.begin = getTimer (); }.executeLater (setObj.delay * 1000, this); } else { this.$_e.onEnterFrame = this.$_e.$_t.onEnterFrame; } } Function.prototype.executeLater = function () { var func = this; var timeToWait = arguments.shift (); var obj = arguments.shift (); var args = arguments; var intervalId = setInterval (function (obj) { func.apply (obj, args); clearInterval (intervalId); }, timeToWait, obj) } ASSetPropFlags (Movieclip.prototype, null, 1, true); ASSetPropFlags (Function.prototype, null, 1, true);