Hi there,
I have this function which randomizes an array loaded from a text file that contains the names of folders that contain the content to be loaded. The problem is that all the content is preloaded at once (12 thumbnail-sized swf’s, that in turn load images), before it displays it in Flash. How would I go about displaying each image as soon as it is loaded, while the rest are still being loaded?
Here’s the code I have:
First frame:
[AS]
stop();
toArray = new Array();
my_var = new LoadVars();
my_var.onLoad = function(success) {
if (success) {
toArray = this.toArray.split(",");
gotoAndPlay(2);
}
};
my_var.load(“content/inspiration/inspirationContents.txt”);
[/AS]
Second Frame:
[AS]
randomNumArr = [];
for (i=0; i<12; i++) {
randomNumArr.push(i);
}
addContent = function (clipNum) {
var ranNum = Math.floor(Math.random()*(randomNumArr.length));
this[“daThumb_”+clipNum].daImageTarget.loadMovie(“content/inspiration/”+toArray[randomNumArr[ranNum]]+"/preview/loadThumb.swf");
randomNumArr.splice(ranNum, 1);
};
[/AS]
And then on the third Frame I add all the contents:
[AS]
addContent(1);
addContent(2);
addContent(3);
.
.
.
addContent(12);
stop();
[/AS]
Any input is really appreciated!!
Thanks,
Rufus