# Smooth motion on resize + thumbnails xml gallery

**URL:** https://forum.kirupa.com/t/smooth-motion-on-resize-thumbnails-xml-gallery/217809
**Category:** Uncategorized
**Created:** [March 2, 2007, 1:47am UTC](https://forum.kirupa.com/t/smooth-motion-on-resize-thumbnails-xml-gallery/217809 "2007-03-02T01:47:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![luquas](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@luquas](https://forum.kirupa.com/u/luquas)
#### Post date: [March 2, 2007, 1:47am UTC](https://forum.kirupa.com/t/smooth-motion-on-resize-thumbnails-xml-gallery/217809/1 "2007-03-02T01:47:36Z")

</div>

Hi,  
I’m having a problem when loading external swf of xml gallery into a container and then trying to move the container smoothly on resize the window. It works fine only at the beginning, but after resizing images don’t come up when clicking thumbnails.

I’m using Kirupa tutorial: [http://www.kirupa.com/developer/mx2004/thumbnails.htm](http://www.kirupa.com/developer/mx2004/thumbnails.htm)

and Rhamej answer: [http://www.kirupa.com/forum/showthread.php?t=199041&page=2&highlight=resize+motion](http://www.kirupa.com/forum/showthread.php?t=199041&page=2&highlight=resize+motion)

Stage.showMenu = false;  
Stage.scaleMode = “noScale”;  
Stage.align = “LT”;  
stageListener = new Object();  
MovieClip.prototype.centerIt = function() {  
this.onEnterFrame = function() {  
var StageX:Number = Math.round(Stage.width/2);  
var StageY:Number = Math.round(Stage.height/2);  
var speed:Number = 5;  
this.\_x += (StageX-this.\_x)/speed;  
this.\_y += (StageY-this.\_y)/speed;  
if (Math.abs(StageX-this.\_x)\<1 && Math.abs(StageY-this.\_y)\<1) {  
this.\_x = StageX;  
this.\_y = stageY;  
delete this.onEnterFrame;  
}  
};  
};  
stageListener.onResize = function() {  
box.centerIt();  
};  
Stage.addListener(stageListener);  
stageListener.onResize();

Thanks for help!

Luk
