Вот код функции:

Код:
function loadImages () {
var images:XML = new XML ();
images.ignoreWhite = true;
images.onLoad = function (success) {
if (success) {
var xml:XMLNode = this.firstChild;
totalImages = xml.childNodes.length;
for (i = 0; i < xml.childNodes.length; i++) {
var imagesTitle:String = xml.childNodes[i].childNodes[0].childNodes[0].nodeValue;
var imagesLarge:String = xml.childNodes[i].childNodes[1].childNodes[0].nodeValue;
var imagesTmb:String = xml.childNodes[i].childNodes[2].childNodes[0].nodeValue;
var imagesDesc:String = xml.childNodes[i].childNodes[3].childNodes[0].nodeValue;
//
bottomBar.rightSide.imageTxt.txt.autoSize = true;
bottomBar.rightSide.imageTxt.txt.text = "1";
//
bottomBar.rightSide.totalTxt.txt.autoSize = true;
bottomBar.rightSide.totalTxt.txt.text = totalImages;
//
displayPositions ();
//
imageTitleArr.push (imagesTitle);
imagesArr.push (imagesLarge);
imageDescArr.push (imagesDesc);
//
tmbs.containerTmbs.attachMovie ("attach","attach" + i,i);
tmbs.containerTmbs["attach" + i]._x = i * 30;
//
loadThumbnails (imagesTmb,tmbs.containerTmbs["attach" + i].picture);
loadThumbnails (imagesTmb,tmbs.containerTmbs["attach" + i].largeTmb.picture);
//
contentBox.contentBox_text.catText.text = categoryTitleForContent;
contentBox.contentBox_text.titleText.text = xml.childNodes[0].childNodes[0].childNodes[0].nodeValue;
contentBox.contentBox_text.descText.htmlText = xml.childNodes[0].childNodes[3].childNodes[0].nodeValue;
contentBox.contentBox_text.descText.autoSize = true;
myListenerload.onResize ();
//
tmbs.containerTmbs["attach" + i].bt.idInstance = i;
//
tmbs.containerTmbs["attach" + i].bt.onRelease = function () {
//
cursorArr = this.idInstance;
//
for (a = 0; a < totalImages; a++) {
if(tmbs.containerTmbs["attach" + a].back._tint == color){
tmbs.containerTmbs["attach" + a].bt.enabled = true;
tmbs.containerTmbs["attach" + a].back._tint = 0x353535;
}
//
if(a > 0){
if(a == totalImages - 1){
tmbs.containerTmbs["attach" + cursorArr].gotoAndPlay("close");
tmbs.containerTmbs["attach" + cursorArr].bt.enabled = false;
tmbs.containerTmbs["attach" + cursorArr].back._tint = color;
}
}
}
//
abortSlideShow ();
//
bottomBar.rightSide.imageTxt.txt.autoSize = true;
bottomBar.rightSide.imageTxt.txt.text = cursorArr + 1;
//
displayPositions ();
//
contentBox.contentBox_text.catText.text = categoryTitleForContent;
contentBox.contentBox_text.titleText.text = imageTitleArr[cursorArr];
contentBox.contentBox_text.descText.htmlText = imageDescArr[cursorArr];
contentBox.contentBox_text.descText.autoSize = true;
myListenerload.onResize ();
//
ZigoEngine.doTween (imageContainer,'_alpha',0,1,"easeOutExpo",0,function () {
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
});
};
}
}
loadBitmapSmoothed (imagesArr[cursorArr],imageContainer);
};
images.load ("contents/data/gallery_category1.xml");
}