# Next button xml gallery

**URL:** https://forum.kirupa.com/t/next-button-xml-gallery/280187
**Category:** Uncategorized
**Created:** [January 23, 2009, 9:05pm UTC](https://forum.kirupa.com/t/next-button-xml-gallery/280187 "2009-01-23T21:05:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jerdunham](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jerdunham](https://forum.kirupa.com/u/jerdunham)
#### Post date: [January 23, 2009, 9:05pm UTC](https://forum.kirupa.com/t/next-button-xml-gallery/280187/1 "2009-01-23T21:05:49Z")

</div>

I am trying to add a next button to an xml photo gallery. I can’t figure out which variable expresses the current xml node associated with the main photo. This function should load the new photo fine.

```auto
extNext.addEventListener(MouseEvent.CLICK,nextPhoto);

function nextPhoto(event:MouseEvent):void {
	
	extNext.removeEventListener(MouseEvent.CLICK, nextPhoto );
	extPicArea.removeChildAt(0);
	var extLoader:Loader = new Loader();
	var extRequest:URLRequest = new URLRequest ([COLOR="Red"]I don't know what goes here[/COLOR])
	extLoader.load( extRequest );
	extLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, extLoaded);
			
			
			
			
			
			function extLoaded(event:Event):void{
				
				
				extNext.addEventListener(MouseEvent.CLICK, nextPhoto );
				extPicPlacementX = ( stage.stageWidth/2) - (extLoader.width/2);
				extPicArea.x = extPicPlacementX;
				extPicArea.y = extPicPlacementY;
				
				extPicArea.addChild(extLoader);
				fadeIn = new Tween(extPicArea, "alpha", None.easeNone, 0, 1, 15, false);
	
				
	
}

}

```

But as you can see I can’t find which variable goes in the URLRequest to make it advance to the next photo. Do I have to make a new variable? All actionscript files are attached. Any help would be appreciated.
