# Need hlep:about mask\_mc begin play & loaded completely

**URL:** https://forum.kirupa.com/t/need-hlep-about-mask-mc-begin-play-loaded-completely/160492
**Category:** flash
**Created:** [August 26, 2005, 9:52am UTC](https://forum.kirupa.com/t/need-hlep-about-mask-mc-begin-play-loaded-completely/160492 "2005-08-26T09:52:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![robon\_hood](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@robon\_hood](https://forum.kirupa.com/u/robon_hood)
#### Post date: [August 26, 2005, 9:52am UTC](https://forum.kirupa.com/t/need-hlep-about-mask-mc-begin-play-loaded-completely/160492/1 "2005-08-26T09:52:37Z")

</div>

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](http://www.impx.nease.net/test.htm)  
here is what i did:

```auto
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;
}
}
}
}

```
