Hey guys!
I am coding a pretty simple photoslide that gets jpgs from an XML-file and tweens between them. Everything is working well, Flash finds the files and goes through them all. The problem I have is that I want to load them in sequence for the people who don’t have fast connections. Right now he loads them all at the same time, which seems pretty unnecessary. I need some way to tell him “if nextpicture is loaded, then tweenToNext()”.
First I load the XML, then I go to frame 2 where the tweening starts. This is how I load the pictures:
stop();
function createSlide(pics_xml) {
var picArray:Array = pics_xml.firstChild.firstChild.childNodes;
//trace(picArray);
for (var i = 0; i<picArray.length; i++) {
var picURL = proj*.attributes.url;
trace (picURL);
this.createEmptyMovieClip("bild" + i, i);
pic_mc = eval("bild" + i);
loadMovie(picURL , mcNamn_mc);
pic_mc._alpha=0;
if (i == proj.length - 1) {
this.gotoAndStop(2);
}
}
}
var pics_xml = new XML();
pics_xml.ignoreWhite = true;
pics_xml.onLoad = function(success) {
if (success) {
trace ("XML loaded.");
createSlide(this);
} else {
trace("Error loading XML file");
}
};
pics_xml.load("xmlBilder.xml");
I would appreciate any thoughts very much =)