# Images from XML not showing

**URL:** <https://forum.kirupa.com/t/images-from-xml-not-showing/283730>\
**Category:** flash\
**Created:** [March 10, 2009, 3:13pm UTC](https://forum.kirupa.com/t/images-from-xml-not-showing/283730 "2009-03-10T15:13:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkoes](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rkoes](https://forum.kirupa.com/u/rkoes)\
**Post date:** [March 10, 2009, 3:13pm UTC](https://forum.kirupa.com/t/images-from-xml-not-showing/283730/1 "2009-03-10T15:13:03Z")

</div>

Hi,  
im pretty new to actionscript but have made a site, its online but none of the images appear to be showing, everything seems to be working fine offline but online its a different story. I loaded 1 set of photos in fine, but when i carried on and wrote the rest of it to accomodate to more sets everything went wrong… ☹

any help would be greatly appreciated…  
this is the site  
[www.neska.co.uk](http://www.neska.co.uk)

heres the code::

/\*\*\*\* IMPORT CLASSES **_/  
import mx.transitions.;  
import mx.transitions.easing._;  
/ **\*\* DECLARE VARIABLES & INSTANCES** /  
var nextX = 0;  
var nextX2 = 0;  
var nextX3 = 0;  
var xmlPhotos:XML = new XML();  
var xmlPhotos2:XML = new XML();  
var xmlPhotos3:XML = new XML();  
/ **CREATE OBJECTS** /  
var initThumb:Object = new Object();  
var initThumb2:Object = new Object();  
var initThumb3:Object = new Object();  
/** HANDLE EVENTS \*\*\*_/  
xmlPhotos.onLoad = function() {  
for (var i:Number = 0; i\<xmlPhotos.firstChild.childNodes.length; i++) {  
initThumb.photo = (xmlPhotos.firstChild.childNodes_.attributes.photo);  
makeAThumb(i);  
nextX += 47.5;  
}  
setInterval(\_root,“scroller”,50);  
empty.\_visible = false;

};

xmlPhotos2.onLoad = function() {  
for (var j:Number = 0; j\<xmlPhotos2.firstChild.childNodes.length; j++) {  
initThumb2.photo = (xmlPhotos2.firstChild.childNodes[j].attributes.photo);  
makeAThumb2(j);  
nextX2 += 47.5;  
}  
};

xmlPhotos3.onLoad = function() {  
for (var k:Number = 0; k\<xmlPhotos3.firstChild.childNodes.length; k++) {  
initThumb3.photo = (xmlPhotos3.firstChild.childNodes[k].attributes.photo);  
makeAThumb3(k);  
nextX3 += 47.5;  
}  
setInterval(\_root,“scroller3”,50);  
empty.\_visible = false;  
};

initThumb.onRollOver = function() {  
thumbFade = new Tween(this, “\_alpha”, none, 40, 100, .2, true);  
};  
initThumb.onRollOut = function() {  
thumbFade.yoyo();  
};  
initThumb.onRelease = function() {  
empty.\_visible = true;  
empty.backBtn.onRelease = function() {  
mainLogo.\_visible = true;  
fashionTitle.\_visible = true;  
archTitle.\_visible = true;  
natureTitle.\_visible = true;  
empty.\_visible = false;  
mcImageGrid1.\_visible = true;  
mcImageGrid2.\_visible = true;  
mcImageGrid3.\_visible = true;  
};

```
empty.emptyBig.loadMovie("images/fashion/"+this.photo+".jpg");
mainLogo._visible = false;
fashionTitle._visible = false;
archTitle._visible = false;
natureTitle._visible = false;
mcImageGrid1._visible = false;
mcImageGrid2._visible = false;
mcImageGrid3._visible = false;

```

};

initThumb2.onRollOver = function() {  
thumbFade2 = new Tween(this, “\_alpha”, none, 40, 100, .2, true);  
};  
initThumb2.onRollOut = function() {  
thumbFade2.yoyo();  
};  
initThumb2.onRelease = function() {  
empty.\_visible = true;  
empty.backBtn.onRelease = function() {  
mainLogo.\_visible = true;  
fashionTitle.\_visible = true;  
archTitle.\_visible = true;  
natureTitle.\_visible = true;  
empty.\_visible = false;  
mcImageGrid1.\_visible = true;  
mcImageGrid2.\_visible = true;  
mcImageGrid3.\_visible = true;  
};  
empty.emptyBig.loadMovie(“images/architecture/”+this.photo+".jpg");  
mainLogo.\_visible = false;  
fashionTitle.\_visible = false;  
archTitle.\_visible = false;  
natureTitle.\_visible = false;  
mcImageGrid1.\_visible = false;  
mcImageGrid2.\_visible = false;  
mcImageGrid3.\_visible = false;  
};

initThumb3.onRollOver = function() {  
thumbFade3 = new Tween(this, “\_alpha”, none, 40, 100, .2, true);  
};  
initThumb3.onRollOut = function() {  
thumbFade3.yoyo();  
};

initThumb3.onRelease = function() {  
empty.\_visible = true;  
empty.backBtn.onRelease = function() {  
mainLogo.\_visible = true;  
fashionTitle.\_visible = true;  
archTitle.\_visible = true;  
natureTitle.\_visible = true;  
empty.\_visible = false;  
mcImageGrid1.\_visible = true;  
mcImageGrid2.\_visible = true;  
mcImageGrid3.\_visible = true;  
};  
empty.emptyBig.loadMovie(“images/nature/”+this.photo+".jpg");  
mainLogo.\_visible = false;  
fashionTitle.\_visible = false;  
archTitle.\_visible = false;  
natureTitle.\_visible = false;  
mcImageGrid1.\_visible = false;  
mcImageGrid2.\_visible = false;  
mcImageGrid3.\_visible = false;  
};

/\*\*\*\* FUNCTIONS **/  
function makeAThumb(num) {  
thumbName = “mcThumb”+num;  
mcImageGrid1.attachMovie(“thumb”,thumbName,num,initThumb);  
mcImageGrid1[thumbName].mcPhoto.loadMovie(“images/fashion/thumbs/”+mcImageGrid1[thumbName].photo+".jpg");  
mcImageGrid1[thumbName].\_x = nextX;  
mcImageGrid1[thumbName].\_y = 0;  
mcImageGrid1[thumbName].\_alpha = 40;  
}  
function makeAThumb2(num) {  
thumbName2 = “mcThumb2”+num;  
mcImageGrid2.attachMovie(“thumb”,thumbName2,num,initThumb2);  
mcImageGrid2[thumbName2].mcPhoto.loadMovie(“images/architecture/thumbs/”+mcImageGrid2[thumbName2].photo+".jpg");  
mcImageGrid2[thumbName2].\_x = nextX2;  
mcImageGrid2[thumbName2].\_y = 0;  
mcImageGrid2[thumbName2].\_alpha = 40;  
}  
function makeAThumb3(num) {  
thumbName3 = “mcThumb3”+num;  
mcImageGrid3.attachMovie(“thumb”,thumbName3,num,initThumb3);  
mcImageGrid3[thumbName3].mcPhoto.loadMovie(“images/nature/thumbs/”+mcImageGrid3[thumbName3].photo+".jpg");  
mcImageGrid3[thumbName3].\_x = nextX3;  
mcImageGrid3[thumbName3].\_y = 0;  
mcImageGrid3[thumbName3].\_alpha = 40;  
}  
function scroller() {  
if (this.\_ymouse\<195) {  
var scrollSpeed = (this.\_xmouse-Stage.width/2)/50;  
if (Math.abs(scrollSpeed)\<1) {  
scrollSpeed = 0;  
}  
mcImageGrid1.\_x -= scrollSpeed;  
if (mcImageGrid1.\_x\>0) {  
mcImageGrid1.\_x = 0;  
} else if (mcImageGrid1.\_x\<Stage.width-mcImageGrid1.\_width) {  
mcImageGrid1.\_x = Stage.width-mcImageGrid1.\_width;  
}  
}  
}  
function scroller3() {  
if (this.\_ymouse\>400) {  
var scrollSpeed = (this.\_xmouse-Stage.width/2)/50;  
if (Math.abs(scrollSpeed)\<1) {  
scrollSpeed = 0;  
}  
mcImageGrid3.\_x -= scrollSpeed;  
if (mcImageGrid3.\_x\>0) {  
mcImageGrid3.\_x = 0;  
} else if (mcImageGrid3.\_x\<Stage.width-mcImageGrid3.\_width) {  
mcImageGrid3.\_x = Stage.width-mcImageGrid3.\_width;  
}  
}  
}  
function fadeIn():Void {  
empty.emptyBig.onEnterFrame = function():Void {  
this.\_alpha += 5;  
if (this.\_alpha\>=100) {  
delete this.onEnterFrame;  
this.\_alpha = 100;  
}  
};  
}  
/ **SET PROPERTIES** /  
xmlPhotos.ignoreWhite = true;  
xmlPhotos2.ignoreWhite = true;  
xmlPhotos3.ignoreWhite = true;  
/** RUN NOW \*\*\*\*/  
xmlPhotos.load(“photos.xml”);  
this.createEmptyMovieClip(“mcImageGrid1”,this.getNextHighestDepth());  
mcImageGrid1.\_x = 0;  
mcImageGrid1.\_y = 155;  
xmlPhotos2.load(“photosarch.xml”);  
this.createEmptyMovieClip(“mcImageGrid2”,this.getNextHighestDepth());  
mcImageGrid2.\_x = 0;  
mcImageGrid2.\_y = 305;  
xmlPhotos3.load(“photosnature.xml”);  
this.createEmptyMovieClip(“mcImageGrid3”,this.getNextHighestDepth());  
mcImageGrid3.\_x = 0;  
mcImageGrid3.\_y = 460;

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_/  
this.onEnterFrame = function() {  
filesize = empty.emptyBig.getBytesTotal();  
loaded = empty.emptyBig.getBytesLoaded();  
empty.preloader.\_visible = true;  
if (loaded != filesize) {  
empty.preloader.preload\_bar.\_xscale = 100_loaded/filesize;  
} else {  
empty.preloader.\_visible = false;  
if (empty.emptyBig.\_alpha\<100) {  
fadeIn();  
}  
}  
};
