Hi all,
Would anyone be interested in helping me convert this code from AS2 to AS3? Any tips or assistance would be greatly appreciated
Thank you!
Timer = function () {
};
Timer.prototype.Play = function(delay, area, callBackObj, callBackFunc) {
this.iniTime = getTimer();
this.delay = delay*1000;
this.area = area;
this.frames = 120;
this.callBackObj = callBackObj;
this.callBackFunc = callBackFunc;
this.onEnterFrame = this.doMotion;
};
Timer.prototype.doMotion = function() {
this.curTime = getTimer();
if((this.curTime-this.iniTime)>this.delay) {
this["timask"+this.area].gotoAndPlay("fin");
delete this.onEnterFrame;
if(this.callBackObj!=undefined) {
this.callBackObj[this.callBackFunc]();
}
} else {
c_frame = Math.floor(((this.curTime-this.iniTime)*(this.frames*this.area))/this.delay)+1*this.area;
this["timask"+this.area].gotoAndStop(c_frame);
}
};
Timer.prototype.Stop = function() {
if(this.onEnterFrame) delete this.onEnterFrame;
};
timer3.__proto__ = Timer.prototype;
b_test.onRelease = function() {
timer3.Play(Number(5),2,_root,"doSomething");
}
function doSomething() {
this.output.text = "Try Again!";
}