╨╧рб▒с>■  ■   ■                                                                                                                                                                                                                                                                                                                                                                                                                                                   Root Entry        pк|Yкr╧ГRASHPб═х│─■   Contents        # Page 1                        ■   ¤                                                                                        !"■   $%&'()*-        .■                                                                                                                                                                                                                                                                                                                                       Root Entry        pк|Yкr╧ГRASHиn ┤─■   Contents         Page 1            ├                    ■   ¤    ■   +                                                                                ,■                                                                                                                                                                                                                                                                                                                                                 CPicPage   CPicLayer   CPicFrame   CPicShapeААА sА%┐Aэ0└∙0┐0@ААА`  sА%┐Aэ0└∙0┐0@АААлк  а  sА%┐Aэ0└∙0┐0@АА є└+?А%0А┌0А┌0А%є?┬+╬0╬0202АА   ?  ╖MАА friedcell    Щ3╠ АААА   ?  оrОmTO = new Timer(true,1000); this.test = function() { trace(getTimer()+':'+mTO.getSplit()+':'+mTO.getTime()); } setInterval(this,'test',1000);АА example     OO АААА   ?  #H b/* Made by fry at friedcellcollective dot net Use and distribute this freely. Just include this comment block. Version 1.1 new Timer:public usage new Timer(global,[split1, split2,...,splitn]) parameters global If set to true the time is retrieved from Date object, if false from getTimer() split1, split2,...,splitn Optional parameters that define how the time is split (default is 1000,60,60,24) returns A reference to the newly created Timer object description Constructor; creates a new Timer object example myTimerObject = new Timer(); myTimerObject = new Timer(true); // global timing myTimerObject = new Timer(true,1000); // split only into milliseconds and seconds Timer._getTime:private Timer.setStart:public usage myTimerObject.setStart(startTime) parameters startTime Start time in milliseconds returns A millisecond value defining the start time of the timer (derived from getTimer() if global is false and from Date object if global is true). description Method; sets the start time of the timer to the specified value. example myTimerObject = new Timer(true); // global myTimerObject.setStart(new Date(2004,0,0)); // start time is set to the start of year 2004 myTimerObject = new Timer(); myTimerObject.setStart(1000); // start time is set to one second after the flash player started Timer.setSplit:public usage myTimerObject.setSplit([split1, split2,...,splitn]) parameters split1, split2,...,splitn Optional parameters that define how the time is split. If not specified no split will be made (returned time will be in milliseconds). returns An array of the time passed from the start of the timer split by the new split array. description Method; sets the array that defines how the passed time is split. example myTimerObject = new Timer(1000,60); equals myTimerObject = new Timer(); myTimerObject.setSplit(1000,60); Timer.restart:public usage myTimerObject.restart() parameters none. returns A millisecond value defining the start time of the timer. description Action; restarts the timer. example myTimerObject = new Timer(); ... myTimerObject.restart(); Timer.getTime:public usage myTimerObject.getTime() parameters none. returns The time in milliseconds passed from the start of the timer description Method; calculates the time spent between now and the start of the timer. example myTimerObject = new Timer(); ... splitTime = myTimerObject.getTime(); Timer.getSplit:public usage myTimerObject.getSplit() parameters none. returns An array of the time passed from the start of the timer split by the internal split array. description Method; calculates the time spent between now and the start of the timer and splits it. example myTimerObject = new Timer(); ... splitTime = myTimerObject.getSplit(); Math.split:public usage Math.split(number, splitArray) parameters number The number to split splitArray The array to split it by returns An array of residuals of division by splitArray description Method; divides the number by every number in the splitArray and puts the residuals in an array. At the end the remaining number is added to the end of the array. example Math.split(15317,[1000]); // returns [317,15] */ _global.Timer = function(global) { this.global = global; this.splitInto = (arguments.length<=1)? [1000,60,60,24] : arguments.slice(1); this.restart(); } Timer.prototype._getTime = function() { if (this.global) { var d = new Date(); return d.valueOf(); } else return getTimer(); } Timer.prototype.setStart = function(startTime) { this.startTime = startTime; return this.startTime; } Timer.prototype.setSplit = function() { this.splitInto = arguments; return this.getSplit(); } Timer.prototype.restart = function() { return this.setStart(this._getTime()); } Timer.prototype.getTime = function() { return this._getTime()-this.startTime; } Timer.prototype.getSplit = function() { var splitInto = (arguments.length==0)? this.splitInto : arguments; return Math.split(this.getTime(),splitInto); } ASSetPropFlags(_global,"Timer",3); ASSetPropFlags(_global.Timer.prototype,"_getTime,setStart,setSplit,restart,getTime,getSplit",3); Math.split = function(num, splitArray) { var r = new Array(); for (var i=0;i