in my work,i need first image loaded completely ,and then ,the mask_mc play its first part to show that image;when i press another botton,the mask_mc play its last part to hide the first image,and after the second image loaded completely, the mask_mc play again to show it.
here is the .swf link:http://www.impx.nease.net/test.htm
here is what i did:
stop();
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
duplicateList();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images_test.xml");
// ///////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (maskmc._currentframe<10 && loadIn) {
maskmc.play();
}
}
};
function firstImage() {
if (loaded == filesize) {
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
//////////////////////////////////
function duplicateList() {
itemX = 0;
clips = [];
for (i=0; i<total; i++, itemX += 55) {
trace(total);
clip.push(mylistmc.listmc.duplicateMovieClip("item"+i, i, {_x:itemX, picNum:i+1, picName:description*}));
}
}
////////////
function checkButtons() {
if (maskmc._currentframe>38) {
maskmc.play();
}else{
maskOut=true;
}
for (i=0; i<total; i++) {
currentItem = "item"+i;
if (currentItem == ActiveItem) {
p = i;
picture_num();
desc_txt.text = description*;
if (loaded == filesize && maskOut) {
picture.loadMovie(image*, 1);
loadIn = true;
}
}
}
}