Timer

Compatible: AS3, flash 8 or greater

Crifano timer component: a basic timer with some functionality like pause and the ability to set events on a specific time!
You can personalize the look and feel and decide if show the hours, minutes, seconds and houndred of seconds.


Api
The component can be used without any scripting. The code hereunder is only for advanced users that need specific actions.

pause
myIstanceName.pause();
This method pause the timer

play
myIstanceName.play();
This method play the timer (after a pause)

reset
myIstanceName.reset();
This method reset to "00" all the field of timer and pause it.

restart
myIstanceName.restart();
This method play the timer starting from 00.

getTimeNow
myIstanceName.getTimeNow();
This method return a string with the actual time of your timer in this format (hh:mm:ss:hs).

getTimeSplitted
var timeNow:Object=myIstanceName.getTimeSplitted();
trace("h: "+timeNow.h+" m: "+timeNow.m+" s: "+timeNow.s+" hs: "+timeNow.hs)

This method return an object containing the hours/minutes/seconds and hundred seconds.

setEventOnTiming
myIstanceName.setEventOnTiming({h:0, m:0, s,2, hs:0});
This method send an object to the component that it will use to return an event on tath specific moment. You had to use this method with the "onTimeSetted" event.

onTimeSetted
myIstanceName.setEventOnTiming({h:0, m:0, s,2, hs:0});
myIstanceName.addEventListener("onTimeSetted",onTimeSetted);
function onTimeSetted(e){
   myIstanceName.pause()
   trace("this is the time you setted");
}

this event is called when a the timer get the exact moment previously setted using "setEventOnTiming".

Crifano © All right reserved
FaceBook     Delicious     Digg     StumbleUpon     | ALL COMPONENTS | FAQ | CONTACT |