# Reposition Images in XML Gallery

**URL:** https://forum.kirupa.com/t/reposition-images-in-xml-gallery/312346
**Category:** flash
**Created:** [July 31, 2010, 6:42pm UTC](https://forum.kirupa.com/t/reposition-images-in-xml-gallery/312346 "2010-07-31T18:42:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ajm97210](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ajm97210](https://forum.kirupa.com/u/ajm97210)
#### Post date: [July 31, 2010, 6:42pm UTC](https://forum.kirupa.com/t/reposition-images-in-xml-gallery/312346/1 "2010-07-31T18:42:42Z")

</div>

If you view my site: [anthonymorones.com](http://anthonymorones.com) and click on the Photography or Graphics button you can see that there are galleries on each of the pages, these are externally loaded XML galleries. When you click on the small image it is supposed to become a larger image but if you click on one of them you will notice that when the image blows up it isn’t centered where it is supposed to be. When I preview the gallery when it isn’t on the website though it works.

There is a lot of code so I will just show the code in regards to the full images:

function callFull(e:MouseEvent):void{  
var full\_loader:Loader = new Loader();  
var full\_url = my\_images[e.target.name].@FULL;  
full\_loader.load(new URLRequest(full\_url));  
full\_loader.contentLoaderInfo.addEventListener(Event.INIT, fullLoaded);

var full\_pb:ProgressBar = new ProgressBar();  
full\_pb.source = full\_loader.contentLoaderInfo;  
full\_pb.x = (stage.stageWidth - full\_pb.width)/2;  
full\_pb.y = (stage.stageHeight - full\_pb.height)/2;  
preloaders\_mc.addChild(full\_pb);

full\_pb.addEventListener(Event.COMPLETE, donePb);

container\_mc.removeEventListener(MouseEvent.CLICK, callFull);  
container\_mc.buttonMode = false;  
container\_mc.removeEventListener(MouseEvent.MOUSE\_OVER, onOver);  
container\_mc.removeEventListener(MouseEvent.MOUSE\_OUT, onOut);  
new Tween(container\_mc, “alpha”, Strong.easeIn, 1,0.5,0.5, true);  
container\_mc\_tween = new Tween(container\_mc, “alpha”, Strong.easeIn, 1,0.5,0.5, true);

}

function fullLoaded(e:Event):void{  
full\_mc = new MovieClip();  
full\_mc.buttonMode = true;  
addChild (full\_mc);  
var my\_loader:Loader = Loader(e.target.loader);  
full\_mc.addChild(my\_loader);  
full\_tween = new Tween(my\_loader, “alpha”, Strong.easeIn, 0,1,0.5, true);  
my\_loader.x = (stage.stageWidth - my\_loader.width)/2;  
my\_loader.y = (stage.stageHeight - my\_loader.height)/2;  
my\_loader.addEventListener(MouseEvent.CLICK,removeFull);

my\_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, fullLoaded);  
}

That is the only AS that would be relevant to the Full Images. The variables that are set up at the top of the code are controlled by this line of code in the XML file:

\<GALLERY COLUMNS=“6” XPOSITION=“17” YPOSITION=“30” WIDTH=“100” HEIGHT=“155”\>

I’ve tried altering those positions but all it does is change the position of the thumbnail images.

Thanks for any help I can get.
