Flash CS3 Slideshow - captions/slow preloader

Hello everyone! I successfully completed a Flash CS3 slideshow. The slideshow contains picture transitions with coordinating captions and can be updated from an XML file.

After figuring out how to get the captions to rotate (finally) with each individual picture and observing a simlulated download using 56k, I noticed my loading bar is delayed for a few seconds showing a blank white screen. This did not happen until I added the captions. Not what I’m going for.

Does anyone know what may have delayed my preloader after reviewing my code below? Any help with this matter is greatly appreciated. Thanks, Michelle

Here is my code:

import mx.transitions.Tween;
import mx.transitions.easing.Strong;
this.createEmptyMovieClip(“container2_mc”,this.getNextHighestDepth());
this.createEmptyMovieClip(“container1_mc”,this.getNextHighestDepth());
this.createEmptyMovieClip(“buttons_mc”,this.getNextHighestDepth());
this.attachMovie(“loader”,“loader_mc”,this.getNextHighestDepth());
loader_mc._x = 175;
loader_mc._y = 250;

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target,bytesLoaded,bytesTotal) {
loader_mc._alpha = 100;
var pct = Math.round(bytesLoaded/bytesTotal*100);
loader_mc.bar_mc._xscale = pct;
}

myListener.onLoadComplete = function(target) {
loader_mc._alpha = 0;
fadeIn();
}

container2_mc._x = Stage.width - container_mc._width - 10;
container2_mc._y = 91;
container2_mc._x = 0;
container2_mc._y = 91;
container1_mc._x = Stage.width - container_mc._width - 10;
container1_mc._y = 91;
container1_mc._x = 0;
container1_mc._y = 91;

buttons_mc.attachMovie(“prev”,“prev_mc”,buttons_mc.getNextHighestDepth());
buttons_mc.attachMovie(“next”,“next_mc”,buttons_mc.getNextHighestDepth());
buttons_mc.next_mc._x = 265;
buttons_mc.next_mc._y = 75;
buttons_mc.prev_mc._x = 250;
buttons_mc.prev_mc._y = 75;

//------XML-------//
var myXML:XML = new XML();
myXML.ignoreWhite = true;

var picArray:Array = new Array();
var captionArray:Array = new Array();
var currentElement:Number = 0;
//create a new array to hold all the captions var captionArray:Array = new Array();
myXML.onLoad = function(success) {
if (success) {
var ss:Array = myXML.firstChild.childNodes;
for (i=0; i<ss.length; i++) {
picArray.push(“images/” + ss*.attributes.url);
//add the caption from the XML document to captionArray
captionArray.push(ss*.attributes.caption);
}
container_mc.loadMovie(urls[currentElement]);

init();
} else

{
trace(“XML could not load”);
}
};
myXML.load(“slideshow.xml”);
var currentContainer:MovieClip = container1_mc;
function init() {
myMCL.loadClip(picArray[currentElement],container1_mc);
//this will trace the caption to the Output panel
captionTextBox.text = captionArray[currentElement]
};

buttons_mc.next_mc.onRelease = function() {
if (currentContainer == container1_mc) {
currentContainer = container2_mc;
} else {
currentContainer = container1_mc;
}
currentContainer._alpha = 0;
container1_mc.swapDepths(container2_mc);
if (currentElement<picArray.length-1) {
currentElement++;
} else {
currentElement = 0;
}
myMCL.loadClip(picArray[currentElement],currentContainer);
//this will trace the caption to the Output panel
captionTextBox.text = captionArray[currentElement]
};
buttons_mc.prev_mc.onRelease = function() {
if (currentContainer == container1_mc) {
currentContainer = container2_mc;

} else {
currentContainer = container1_mc;

}
currentContainer._alpha = 0;
container1_mc.swapDepths(container2_mc);
if (currentElement>0) {
currentElement–;
} else {
currentElement = picArray.length-1;
}

myMCL.loadClip(picArray[currentElement],currentContainer);
//this will trace the caption to the Output panel
captionTextBox.text = captionArray[currentElement]
};

function fadeIn() {
new Tween(currentContainer,"_alpha",Strong.easeOut,0,100,36,false);
}