# Question about Scotty's file

**URL:** <https://forum.kirupa.com/t/question-about-scottys-file/164880>\
**Category:** flash\
**Created:** [October 5, 2005, 6:29pm UTC](https://forum.kirupa.com/t/question-about-scottys-file/164880 "2005-10-05T18:29:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debbie\_H](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Debbie\_H](https://forum.kirupa.com/u/Debbie_H)\
**Post date:** [October 5, 2005, 6:29pm UTC](https://forum.kirupa.com/t/question-about-scottys-file/164880/1 "2005-10-05T18:29:22Z")

</div>

Hi,

I’m trying to load one of Scotty’s files (xml\_pg\_total\_mx2004) as a movie into itself to end up with 2 xml galleries in one document. But after the movie with gallery #2 loads the buttons on gallery #1 don’t work anymore and the current image gets stuck. Thanks for any help.

[AS]

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
comment = [];  
caption = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
comment\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
caption\* = xmlNode.childNodes\*.childNodes[3].firstChild.nodeValue;  
}  
id = setInterval(preloadPic, 100);  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“images.xml”);  
var loadTot = 0;  
var k = 0;  
// ///////////////////////////////////

function preloadPic() {  
clearInterval(id);  
var con = picture.duplicateMovieClip(“con”+k, 9984+k);  
con.loadMovie(image[k]);  
var temp = \_root.createEmptyMovieClip(“temp”+k, 99+k);  
temp.onEnterFrame = function() {  
var total = con.getBytesTotal();  
var loaded = con.getBytesLoaded();  
percent = Math.round((loaded/total\*100)/image.length);  
preloader.preload\_bar.\_xscale = loadTot+percent;  
info.text = "loading image “+k+” of “+image.length+” ";  
if (loaded == total && total\>4) {  
con.\_visible = 0;  
nextPic();  
loadTot += percent;  
delete this.onEnterFrame;

```
	}
	
	
	
};

```

}  
function nextPic() {  
if (k\<image.length-1) {  
k++;  
preloadPic();  
} else {  
firstImage();  
contents.swapDepths(9999);

```
}

```

}

// ///////////////////////////////////  
var p = 0;  
var current;  
MovieClip.prototype.fadeIn = function() {  
if (this.\_alpha\<100) {  
current.\_alpha -= 10;  
this.\_alpha += 10;  
} else {  
current.\_visible = 0;  
delete this.onEnterFrame;  
}

previous\_btn.onRelease = function() {  
prevImage();  
};  
next\_btn.onRelease = function() {  
nextImage();  
};

```
};

```

function nextImage() {  
current = this[“con”+p];  
p++;

```
/////////////////////////////////////
            if (p == 0) {
                     

                     preloader._visible = false;}
					 /////////////////////////////////////
					 
					 /////////////////////////////////////
            if (p == 1) {
                     

                     preloader._visible = false;}
					 /////////////////////////////////////
					 /////////////////////////////////////
					 if (p == 3) {
                     contents.loadMovie("xml_pg_total_mx2004_2.swf");
					 } else { 
                     contents._visible = false;}
					 

/////////////////////////////////////

var picture = this["con"+p];
picture._visible = 1;
picture._alpha = 0;
picture.onEnterFrame = fadeIn;
desc_txt.text = description[p];
comment_txt.text = comment[p];
caption_txt.text = caption[p];
picture_num();

```

}  
function prevImage() {  
current = this[“con”+p];  
p–;  
if (p == 3) {  
contents.loadMovie(“xml\_pg\_total\_mx2004\_2.swf”);  
} else {  
contents.\_visible = false;}  
var picture = this[“con”+p];  
picture.\_visible = 1;  
picture.\_alpha = 0;  
picture.onEnterFrame = fadeIn;  
desc\_txt.text = description[p];  
comment\_txt.text = comment[p];  
caption\_txt.text = caption[p];  
picture\_num();  
}  
function firstImage() {  
con0.\_visible = 1;  
con0.\_alpha = 0;  
con0.onEnterFrame = fadeIn;  
desc\_txt.text = description[0];  
comment\_txt.text = comment[0];  
caption\_txt.text = caption[0];  
picture\_num();  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" of "+total;  
if (p == 0) {  
previous\_btn.\_alpha = 50;  
previous\_btn.enabled = false;  
} else {  
previous\_btn.\_alpha = 100;  
previous\_btn.enabled = true;  
}  
if (p == (total-1)) {  
next\_btn.\_alpha = 50;  
next\_btn.enabled = false;  
} else {  
next\_btn.\_alpha = 100;  
next\_btn.enabled = true;  
}  
}

[/AS]
