AS2 gallery importing from xml - more than 22 images and

Hi to all who visit this thread…

I have created a simple image gallery of the back of oman3d.com tutorial.

It imports images listed in a xml file to flash. it works fine untill i add more than 22 images . if i have any more than 20 images the tweening (fading in and out )goes all jerky if not at all, and does not run smoothly. any help would be really appreciated.

To view the issue in action is http://www.djgriffiths.co.uk

Thanks

Please find the code below:

xml:
<slideshow width=“765” height=“510” speed=“3”>
<image url=“images/image01.jpg” title="" />
<image url=“images/image02.jpg” title="" />
<image url=“images/image03.jpg” title="" />
<image url=“images/image04.jpg” title="" />
<image url=“images/image05.jpg” title="" />
<image url=“images/image06.jpg” title="" />
<image url=“images/image07.jpg” title="" />
<image url=“images/image08.jpg” title="" />
<image url=“images/image09.jpg” title="" />
<image url=“images/image10.jpg” title="" />
<image url=“images/image11.jpg” title="" />
<image url=“images/image12.jpg” title="" />
<image url=“images/image13.jpg” title="" />
<image url=“images/image14.jpg” title="" />
<image url=“images/image15.jpg” title="" />
<image url=“images/image16.jpg” title="" />
<image url=“images/image17.jpg” title="" />
<image url=“images/image18.jpg” title="" />
<image url=“images/image19.jpg” title="" />
<image url=“images/image20.jpg” title="" />
<image url=“images/image21.jpg” title="" />
<image url=“images/image22.jpg” title="" />
<image url=“images/image23.jpg” title="" />
<image url=“images/image24.jpg” title="" />
<image url=“images/image25.jpg” title="" />
<image url=“images/image26.jpg” title="" />
<image url=“images/image27.jpg” title="" />
<image url=“images/image28.jpg” title="" />
</slideshow>

Action script code:

import mx.transitions.Tween;
import mx.transitions.easing.*;

var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load(“slideshow.xml”);

 var format:TextFormat = new TextFormat();
        format.font = "Verdana";
        format.color = 0x666666;
        format.size = 10;
        format.underline = false;

_root.myText_txt.text = “test”;

myShowXML.onLoad = function() {

_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;

_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;

createContainer();
callImages();
updateSize();
};

/*

function createContainer() {
_root.createEmptyMovieClip(“myContainer_mc”,_root. getNextHighestDepth());

//border around movie clip
myContainer_mc.lineStyle(0,0x000000,0);
myContainer_mc.lineTo(_root.myWidth,0);
myContainer_mc.lineTo(_root.myWidth,_root.myHeight );
myContainer_mc.lineTo(0,_root.myHeight);
myContainer_mc.lineTo(0,0);

myContainer_mc._x = (Stage.width-myContainer_mc._width)/2;
myContainer_mc._y = (Stage.height-myContainer_mc._height)/2;

}
*/
function callImages() {

_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);

_root.myClips_array = [];

_root.myPreloader.onLoadStart = function(target) {

_root.createTextField(“myText_txt”,_root.getNextHi ghestDepth(),0,0,100,20);
_root.myText_txt._x = (Stage.width-_root.myText_txt._width)/2;
_root.myText_txt._y = (Stage.height-_root.myText_txt._height)/2;
_root.myText_txt.autoSize = “center”;
_root.myText_txt.setNewTextFormat(format);

};

_root.myPreloader.onLoadProgress = function(target){

_root.myText_txt.text = “Loading… “+_root.myClips_array.length+”/”+_root.myImagesNo+" Completed";

}

_root.myPreloader.onLoadComplete = function(target) {

_root.myClips_array.push(target);
target._alpha=0;

if (_root.myClips_array.length == _root.myImagesNo) {

_root.myText_txt._y = myContainer_mc._y + myContainer_mc._height;
moveSlide();
myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);

}

}

for (i=0; i<_root.myImagesNo; i++) {

temp_url = _root.myImages*.attributes.url;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());

_root.myMCL.loadClip(temp_url,temp_mc);
}

}

function moveSlide (){

current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, “_alpha”, Strong.easeOut, 100, 0, 1, true);

_root.target_mc++;

if (_root.target_mc >= _root.myImagesNo){
_root.target_mc = 0;
}
_root.myText_txt.text = _root.myImages[target_mc].attributes.title;
next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, “_alpha”, Strong.easeOut, 0, 100, 1, true);

}

the web address to view the issue in action is http://www.djgriffiths.co.uk