# Load first image in photo gallery?

**URL:** <https://forum.kirupa.com/t/load-first-image-in-photo-gallery/207869>\
**Category:** Uncategorized\
**Created:** [November 22, 2006, 9:31am UTC](https://forum.kirupa.com/t/load-first-image-in-photo-gallery/207869 "2006-11-22T09:31:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hema77](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@hema77](https://forum.kirupa.com/u/hema77)\
**Post date:** [November 22, 2006, 9:31am UTC](https://forum.kirupa.com/t/load-first-image-in-photo-gallery/207869/1 "2006-11-22T09:31:39Z")

</div>

HI! I have done a photo gallery using the following code. However, I need the first picture to appear as the movieclip is loaded. What shall I introduce to this script? Or what would I have to change?

myPhoto = new XML();  
myPhoto.ignoreWhite = true;  
myPhoto.onLoad = function(success) {  
//portfolioTag = this.firstChild;  
numimages = this.firstChild.childNodes.length;  
spacing = 70;  
for (i=0; i\<numimages; i++) {  
this.picHolder = this.firstChild.childNodes\*;  
this.thumbHolder = thumbnails.createEmptyMovieClip(“thumbnail”+i, i);  
this.thumbHolder.\_y = i\*spacing;  
this.thumbLoader = this.thumbHolder.createEmptyMovieClip(“thumbnail\_image”, 0);  
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);  
this.thumbHolder.title = this.picHolder.attributes.title;  
this.thumbHolder.main = this.picHolder.attributes.main;  
this.thumbHolder.onRelease = function() {  
loader.loadMovie(this.main);  
title\_txt.text = this.title;  
};  
}  
};  
myPhoto.load(“images.xml”);

thanks
