1

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.

Megan
  • 11
  • 3

1 Answers1

0

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.

Atriace
  • 2,572
  • 1
  • 14
  • 27
  • well gaia has external movieclips loading on the main swf, my animation is stored on index.swf the navigation loads on top of the index .swf as nav.swf and pages load on top of that. i really am pretty new to as3 so i'm finding it tough to figure out where to write the function. – Megan May 17 '12 at 07:38
  • I briefly looked at GAIA's website, and it seems you're likely loading the site from an XML definition. If that's the case, GAIA appears to also preload that content before anything else loads which is why everything appears at once. The solution is to specifically load each asset on-demand, and the documentation for that can be found here: [link](http://www.gaiaflashframework.com/wiki/index.php?title=Assets#Load-On-Demand_Assets). If you're using the Flash Professional IDE to write your code (ie., "Actions" panel), place the above code at the beginning, and your load() commands in foo(). – Atriace May 17 '12 at 15:02