As2.0

Hi

I am working on a slideshow where images are loaded from XML.
Currently the slide show starts when all the images are loaded.

I want to preload one image at one time i.e when first image is loaded,first image should be displayed then preloader for next image is to be shown and after that next images is displayed and so on…

Plz can some one help me with this

Here’s some code I posted onto Actionscript dot org a fair while ago - it may help you out. Basically the bit to look at is the function: loadNewImage(img) which has an onComplete handler - when the this is called it recursively calls the same function to load the next image until they are all in.

May or may not help but worth a try.

MJ

fscommand(“allowscale”, false);
_root._quality = “BEST”;
stop();
var home:MovieClip = this;

path = ‘’; // path to images folder
loaderClips = new Array(home.loaderOne,home.loaderTwo,home.loaderThree,home.loaderFour,home.loaderFive,home.loaderSix);
i=0; // counter to track what image you are on

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.load(“icons.xml”);
xml.onLoad = function(success) {
if (success) {
var nodes = this.firstChild.childNodes;

	// make a globally available array of images
	_root.ar_images = new Array(
		nodes[0].attributes.image,
		nodes[1].attributes.image,
		nodes[2].attributes.image,
		nodes[3].attributes.image,
		nodes[4].attributes.image,
		nodes[5].attributes.image
	);
	_root.loadNewImage(_root.ar_images[_root.i]);
	};

};

function loadNewImage(img) {

var myClip = eval(_root.loaderClips[_root.i]);
var imageName = _root.path+img;

var myMC = new MovieClipLoader();

myMC.loadClip(imageName,myClip);

myMC.onLoadStart = function(myClip) {
	trace("loading "+img+" into "+myClip);
}

myMC.onLoadComplete = function (myClip) {
	if(_root.i<(_root.ar_images.length-1)) {
		_root.i++; // increment the counter
		_root.loadNewImage(_root.ar_images[_root.i]); // load next image
	} else { // play movie once all have loaded
		home.play();
	}
}

myMC.onLoadError = function (myClip, errorDetails) {
	trace("error loading "+img+" into "+myClip);
	trace ("ERRORCODE:" + errorDetails);
}

}

Thanks MJ

I will try your code…

can some one edit my fla and give me the solution…
as i am not able to integrate other code in it…

i have attached it in the first post