Looking for a function

Hello

I load images into an array on my site, the problem is that the array takes some to fill up. Is there a function that does: “When I am done, the rest of the site can continue loading”, i.e. I want to finish filling the arrays before the image gallery loads… Now, I get an error message from the first image gallery, because the array hasn’t finished loading when it tries to put the images into their image mc’s…

Here is the loading code:


songsArray;

function loadArray(){

	lvSongs = new LoadVars();
 
	lvSongs.load("songs.php");
	lvSongs.onLoad = function(success) {
		if (success) {
			songsArray = this.imgList.split(", ");
			} 
		else {trace("could not load file"); }
	}
}

function getArray(){
	if(path == "songs"){return songsArray;}
}

In this way, the image library access the array from *getArray()…
*What should I do about this problem?

regards, henrik