Delay loading an external swf on website first load (GAIA)

415 views Asked by At

I am using the Gaia Framework (AS3) to build my first flash website.

I have an animated background which i have placed on the index.fla, and my page content loads as external swf's on top of the index.fla.

My problem is that my intial animation sequence lasts around 10 seconds and i would like to delay the home page from loading till the animation sequence is complete (right now it just loads on top of the animation). The animation is played once, so the delay for page loading should occur only the first time the site loads or when the site is refreshed.

Please let me how to achieve this delay.

1

There are 1 answers

2
Atriace On

I'm not familiar with Gaia, however, what you want to accomplish isn't difficult. With vanilla AS3 and the Timer class.

var delayTimer:Timer = new Timer(10000, 1); // these are in milliseconds.
delayTimer.addEventListener(TimerEvent.TIMER, foo);
delayTimer.start()

function foo(e:Event):void {
   // Do your stuff to load everything else.
}

To summarize, you create a timer, you add a listener for the end of the countdown called foo and it kicks-off the rest of the loading you wanted to to do after the wait.