# Newbie XML question

**URL:** <https://forum.kirupa.com/t/newbie-xml-question/178490>\
**Category:** Uncategorized\
**Created:** [February 10, 2006, 11:30pm UTC](https://forum.kirupa.com/t/newbie-xml-question/178490 "2006-02-10T23:30:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dugan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dugan](https://forum.kirupa.com/u/dugan)\
**Post date:** [February 10, 2006, 11:30pm UTC](https://forum.kirupa.com/t/newbie-xml-question/178490/1 "2006-02-10T23:30:14Z")

</div>

I am an XML newbie, working with Scotty’s gallery,[kirupaForum](http://www.kirupa.com/forum/showthread.php?t=87388), I am trying to modify the below script and disable the action that “shows image on load” (I only want to view image when a button is pressed) but I can not find it in the action in the script, can some clarify. I appreciate you help

> var tnNr;  
> spacing = 0;  
> \_root.container.\_alpha = 0;  
> var curLength;  
> MovieClip.prototype.loadPic = function(pic, id) {  
> info.text = “”;  
> this.\_alpha = 0;  
> this.loadMovie(pic);  
> temp = this.\_parent.createEmptyMovieClip(“temp2”, 998);  
> temp.onEnterFrame = function() {  
> var t = \_root.container.getBytesTotal(), l = \_root.container.getBytesLoaded();  
> if (Math.round(l/t) == 1 && \_root.container.\_width != 0 && \_root.container.\_height != 0) {  
> var w = \_root.container.\_width+spacing, h = \_root.container.\_height+spacing;  
> border.resizeMe(w, h, id);  
> delete this.onEnterFrame;  
> }  
> };  
> };

MovieClip.prototype.resizeMe = function(w, h, id) {  
var speed = 3;  
\_root.container.\_alpha = 0;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
if (Math.abs(this.\_width-w)\<1 && Math.abs(this.\_height-h)\<1) {  
this.\_width = w;  
this.\_height = h;  
\_root.container.\_x = this.\_x-this.\_width;  
\_root.container.\_y = this.\_y-this.\_height;  
info.\_y = Math.round(this.\_y+this.\_height/2+spacing/2);  
\_root.container.\_alpha += 5;  
if (\_root.container.\_alpha\>90) {  
info.text = id;  
\_root.container.\_alpha = 100;  
delete this.onEnterFrame;  
}  
}  
};  
};

function galleryChoice(q) {  
pArray = new Array();  
tArray = new Array();  
iArray = new Array();  
my\_xml = new XML();  
for (var j = 0; j\<curLength; j++) {  
this.th\_nav[“thmb”+j].removeMovieClip();  
}  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(loaded) {  
if (loaded) {  
gallery = this.firstChild.childNodes[q];  
curLength = gallery.childNodes.length;  
for (var i = 0; i\<gallery.childNodes.length; i++) {  
pArray.push(gallery.childNodes\*.attributes.source);  
tArray.push(gallery.childNodes\*.attributes.thumb);  
iArray.push(gallery.childNodes\*.attributes.title);  
}  
}  
delay = setInterval(makeButtons, 50);  
};  
my\_xml.load(“gallery.xml”);  
}  
function makeButtons() {  
tnNr = 0;  
clearInterval(delay);  
for (var i = 0; i\<tArray.length; i++) {  
var thb = th\_nav.thmb.duplicateMovieClip(“thmb”+i, 1000+i);  
thb.id = i;  
thb.\_x = -i%24_40;  
thb.\_y = i%1_50;  
}  
loadButtons();  
}  
function loadButtons() {  
var tbox = th\_nav[“thmb”+tnNr].box;  
tbox.loadMovie(tArray[tnNr]);  
temp = this.createEmptyMovieClip(“tmp”+tnNr, 999);  
temp.onEnterFrame = function() {  
bt = tbox.getBytesTotal();  
bl = tbox.getBytesLoaded();  
if (bt == bl && bt\>4) {  
nextButton();  
delete this.onEnterFrame;  
}  
};  
}  
function nextButton() {  
if (tnNr\<tArray.length-1) {  
tnNr++;  
loadButtons();  
} else {  
activateButtons();  
}  
}  
function activateButtons() {  
mainButtons();  
for (var i = 0; i\<pArray.length; i++) {  
var but = th\_nav[“thmb”+i];  
but.id = i;  
but.onRelease = function() {  
\_root.container.loadPic(pArray[this.id], iArray[this.id]);  
disButtons2(this.id);  
};  
}  
\_root.container.loadPic(pArray[0], iArray[0]);  
disButtons2(0);  
}  
butArray = new Array();  
butArray = [“p\_0212”, “p\_9806”, “gal3\_btn”, “gal4\_btn”];  
function mainButtons() {  
for (var i = 0; i\<butArray.length; i++) {  
this[butArray\*].id = i;  
this[butArray\*].onRelease = function() {  
\_root.portfolio.gotoAndStop(“scatter”);  
galleryChoice(this.id);  
disButtons(this.id);  
};  
}  
}  
function disButtons2(d) {  
for (var i = 0; i\<tArray.length; i++) {  
if (i != d) {  
this.th\_nav[“thmb”+i].enabled = 1;  
this.th\_nav[“thmb”+i].box.\_alpha = 100;  
} else {  
this.th\_nav[“thmb”+i].enabled = 0;  
this.th\_nav[“thmb”+i].box.\_alpha = 50;  
}  
}  
}  
function disButtons(d) {  
for (var i = 0; i\<butArray.length; i++) {  
if (i != d) {  
this[butArray\*].enabled = 1;  
this[butArray\*].gotoAndStop(1);  
} else {  
this[butArray\*].enabled = 0;  
this[butArray\*].gotoAndStop(2);  
}  
}  
}  
disButtons(0);  
galleryChoice(0);
