# XML wrong image

**URL:** <https://forum.kirupa.com/t/xml-wrong-image/303157>\
**Category:** flash\
**Created:** [January 15, 2010, 1:35am UTC](https://forum.kirupa.com/t/xml-wrong-image/303157 "2010-01-15T01:35:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nate51](https://avatars.discourse-cdn.com/v4/letter/n/4da419/32.png) [@nate51](https://forum.kirupa.com/u/nate51)\
**Post date:** [January 15, 2010, 1:35am UTC](https://forum.kirupa.com/t/xml-wrong-image/303157/1 "2010-01-15T01:35:55Z")

</div>

I have XML working great, the button gets labelled properly and the description is proper but for some reason my main image skips to the next image in the XML.

This is my AS 2.0

```auto
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
 if(success) {
  //process data
  allGalleryData = this.firstChild.childNodes;
  for (i=0; i<allGalleryData.length; i++) {
   newPiece = sliderHolder_mc.slider_mc.attachMovie('template', 'piece'+i, i);
   newPiece._x = i*newPiece._width;
   newPiece.heading_txt.text = allGalleryData*.firstChild.firstChild;
   newPiece.desc_txt.text = allGalleryData*.firstChild.nextSibling.firstChild;
   newBut.imageName = allGalleryData*.firstChild.nextSibling.nextSibling.firstChild;
   newBut = _root.attachMovie('numTemplate', 'num'+i, i);
   newBut._x = sliderHolder_mc._x+sliderHolder_mc._height;
   newBut._y = (i*newBut._height)+sliderHolder_mc._y;
   newBut._x = 300;
   newBut.myNum = i;
   newBut.num_txt.text = allGalleryData*.firstChild.firstChild;
   newBut.onRelease = function() {
    loadNewImage('images/'+this.imageName);
    targX = 0-(this.myNum*200);
   };
  }
  targX = 0;
  sliderHolder_mc.slider_mc.onEnterFrame = function() {
   this._x -= (this._x-targX)/5;
  };
 } else {
  trace('file is missing');
 }
};
myXML.load('xml/images.xml');

preloader_mc._alpha = 0;
function loadNewImage(imageName) {
 nextImage = imageName;
 bigImage_mc.onEnterFrame = function() {
  if (this._alpha>0) {
   this._alpha -= 10;
  } else {
   this.loadMovie(nextImage);
   setTimeout(preload,500)
   this.onEnterFrame = null;
  }
 };
}
function preload(){
preloader_mc.onEnterFrame = function() {
 l = bigImage_mc.getBytesLoaded();
 t = bigImage_mc.getBytesTotal();
 p = Math.round((l/t)*100);
 if (p<100) {
  if (this._alpha<100) {
   this._alpha += 20;
  }
  this.gotoAndStop(p);
 } else {
  this.gotoAndStop(100)
  if (this._alpha>0) {
   this._alpha -= 20;

  } else {
   fadeIn();
   this.onEnterFrame = null;
  }
 }
};
}

function fadeIn() {
 bigImage_mc.onEnterFrame = function() {
  if (this._alpha<100) {
   this._alpha += 10;
  } else {
   this.onEnterFrame = null;
  }
 };
}

```

Does anyone see what I am doing wrong here?
