StealingVision
11-08-2008, 10:14 PM
I'm trying to make a simple splash screen with my logo animation before the real animation starts. I don't want to add more frames so I made the animation into a movie clip with the stop(); function at the end. This is the code I put in the main timeline on frame 1
stop();
var nextTimer:Timer = new Timer(5000);
var preloader = new Preloader();
addChild(preloader);
preloader.x = 360;
preloader.y = 240;
stage.addEventListener(TimerEvent.TIMER, playFrame);
function playFrame(e:TimerEvent):void
{
gotoAndPlay(nextFrame);
removeChild(preloader);
}
nextTimer.start();
I get no errors and the preloader works gets added and plays just fine (it's not really a preloader, it's the name of my animation) but the timer never sets off the function. Any idea what's going wrong?
stop();
var nextTimer:Timer = new Timer(5000);
var preloader = new Preloader();
addChild(preloader);
preloader.x = 360;
preloader.y = 240;
stage.addEventListener(TimerEvent.TIMER, playFrame);
function playFrame(e:TimerEvent):void
{
gotoAndPlay(nextFrame);
removeChild(preloader);
}
nextTimer.start();
I get no errors and the preloader works gets added and plays just fine (it's not really a preloader, it's the name of my animation) but the timer never sets off the function. Any idea what's going wrong?