Posted by Sankar.G | Posted in AS3 | Posted on 3:59 PM
var min:Number=0;
var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, myFunction);
min_txt.text=String(min);
function myFunction(event:TimerEvent):void
{
sec_txt.text=String(myTimer.currentCount);
if(myTimer.currentCount==10)
{
myTimer.stop();
myTimer.reset();
myTimer.start();
min=min+1;
min_txt.text=String(min);
}
}
myTimer.start();
Create 2 text box and Name it as sec_txt & min_txt and put this script
var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, myFunction);
min_txt.text=String(min);
function myFunction(event:TimerEvent):void
{
sec_txt.text=String(myTimer.currentCount);
if(myTimer.currentCount==10)
{
myTimer.stop();
myTimer.reset();
myTimer.start();
min=min+1;
min_txt.text=String(min);
}
}
myTimer.start();
Create 2 text box and Name it as sec_txt & min_txt and put this script
Comments (0)
Post a Comment