TayImagery
February 13th, 2008, 11:50 AM
Please forgive may massive AS3 ignorance.
The code snippet below is intended to delay the (MouseEvent.MOUSE_UP, up) function. "up" triggers a new URLRequest. The code above the snippet is error-free and "up" results in navigation to the new URL. Adding the snippet below causes no errors, but the delay doesn't occur and the tick and ding trace statements are not being outputted. The code was adapted from the AS3 Bible. Can anyone see what's wrong? Thanx!!
BTW, the import flash.utils.*; base class is imported
const TIMER_DELAY:Number = 1500;
var timer:Timer;
function TimerJet () {
timer = new Timer (TIMER_DELAY, 1);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
timer.addEventListener(MouseEvent.MOUSE_UP, up);
timer.start ();
}
function onTimer(event:TimerEvent):void {
trace("Tick")
}
function onTimerComplete (event:TimerEvent):void {
trace ("Ding");
}
The code snippet below is intended to delay the (MouseEvent.MOUSE_UP, up) function. "up" triggers a new URLRequest. The code above the snippet is error-free and "up" results in navigation to the new URL. Adding the snippet below causes no errors, but the delay doesn't occur and the tick and ding trace statements are not being outputted. The code was adapted from the AS3 Bible. Can anyone see what's wrong? Thanx!!
BTW, the import flash.utils.*; base class is imported
const TIMER_DELAY:Number = 1500;
var timer:Timer;
function TimerJet () {
timer = new Timer (TIMER_DELAY, 1);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
timer.addEventListener(MouseEvent.MOUSE_UP, up);
timer.start ();
}
function onTimer(event:TimerEvent):void {
trace("Tick")
}
function onTimerComplete (event:TimerEvent):void {
trace ("Ding");
}