I’ve run into quite a problem with a project I’ve been working on for a University.
We’re loading 4 different pieces of .XML data into flash and creating a dynamic slideshow from it.
you can see it here: http://www.gigantenicaragua.com/RisingStar/risingstar.html
After the XML data is loaded into it goes through and counts how many “slides” there are, picks a random rumber from that and displays that “slide”. When NEXT is clicked it plays the next “slide” in incremental order unless it’s at the last slide… then it goes to the first.
The problem I’ve run into is that the animation tweens the iamge before it is loaded into it’s container MC. I need a way to load the images BEFORE that animation fires.
Here’s where I’m loading the XML (from a variable set in HTML):
_global.xmlFinishedLoading = false;
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(sucess) {
if (sucess) {
trace ("XML loaded");
_global.xmlStuff = new XML(this);
//gotoAndPlay(2);
} else {
_root.debug.text = "couldn't load XML file";
}
};
//loading xml from html variable
my_xml.load(_root.xmlFile);
Here’s where I’m loading the images into the container MC:
if (_global.xmlStuff.childNodes[0].childNodes*.childNodes[j].nodeName == "image") {
//trace("image path is: " + _global.xmlStuff.childNodes[0].childNodes*.childNodes[j].firstChild);
var imgPath = _global.xmlStuff.childNodes[0].childNodes*.childNodes[j].firstChild;
//trace(imgPath);
imageArea.loadMovie(imgPath);
}
Is there some kind of handler or listener I can put on the last line? Someone point me in the right direction please… I want the image to load completely before the next frame.