views:

90

answers:

0

I know this has been asked to death, but I cant seem to find the answer i'm looking for... I've put together a simple Flash/XML image gallery and I would like to preload the images - Simple process.

  1. Get the XML data
  2. Preload the images
  3. When all images are preloaded, go to next frame

Here is my code thus far:

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.load("xmltest.xml");

myXML.onLoad = function(success){
 if(success){
  var myImage = myXML.firstChild.childNodes;

  for (i=0; i<myImage.length; i++){
   var imageNumber = i+1;
   var imageName = myImage[i].attributes.name;
   var imageURL = myImage[i].firstChild.nodeValue;

   trace('image #: ' + imageNumber);
   trace('image name: ' + imageName);
   trace('image url: ' + imageURL + '\n');
  }
 }
}