Countdown problem
hello everyone. i'm making flash game , need little countdown.
here's code
var contagem:number = 30;
var meutempo:timer = new timer(1000,contagem);
meutempo.addeventlistener(timerevent.timer, countdown);
meutempo.start();
function countdown(event:timerevent):void {
tmp.text = "tempo:" + string((contagem)- meutempo.currentcount);
if((contagem)-meutempo.currentcount==0)
{
gotoandplay(12)
}
}
i want code in multiple frames. everytime test movie error appears:
error #1009: cannot access property or method of null object reference.
@ teste_fla::maintimeline/countdown()[teste_fla.maintimeline::frame1:83]
@ flash.utils::timer/flash.utils:timer::_timerdispatch()
@ flash.utils::timer/flash.utils:timer::tick()
i think error here
tmp.text = "tempo:" + string((contagem)- meutempo.currentcount); (frame1:83)
can me?
thanks in advance.
tmp not exist when code executes , error appears.
More discussions in ActionScript 3
adobe
Comments
Post a Comment