PDA

View Full Version : Delaying load of one swf until another loads


tsniff
09-07-2005, 07:47 AM
I have two swf's running on a page. One is a sender and one is a receiver. The receiver is a dynamic text box that changes when something is pressed on the sender.

I notice now and then the sending and receiving does not work properly. I've come to believe it is because one is loading before the other at times. The sender is 6kb while the receiver is 34kb. The sender is loaded later in the html from the receiver.

Is there an order that they need to be loaded? If so, is there any way to prevent any script from being ran in each until each know the other has loaded 100%? Maybe have both of them show something like "please wait" until both have loaded completely.

tarjinder80
09-07-2005, 08:10 AM
use getBytesLoaded and getBytesTotal method
when getBytesLoaded==getBytesTotal load second swf
or
place a movieclip
on first frame of movieclip write stop();
give gap of 20-30 frame and in the end call function which wil load second swf
When u want to load second swf write movieclip.gotoAndPlay(2);
This will solve ur problem

mambenanje
09-07-2005, 09:20 AM
adding to the above you can prevent any user event by disabling both swf files till they are all loaded, use localconnections and getbytesloaded to check for the load status and once loaded you activate user interface