# Reorganizing thumbnail columns on Browser resize

**URL:** <https://forum.kirupa.com/t/reorganizing-thumbnail-columns-on-browser-resize/246322>\
**Category:** flash\
**Created:** [December 10, 2007, 3:33am UTC](https://forum.kirupa.com/t/reorganizing-thumbnail-columns-on-browser-resize/246322 "2007-12-10T03:33:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [December 10, 2007, 3:33am UTC](https://forum.kirupa.com/t/reorganizing-thumbnail-columns-on-browser-resize/246322/1 "2007-12-10T03:33:34Z")

</div>

Hi,

I am currently using an xml gallery with the thumbnails being loaded dynamically.  
They are basically organized using these variables when the movie loads:

var widthThumb:Number = 80; // thumb width  
var heightThumb:Number = 80; // thumb height  
var sepThumb:Number = 5; // separation between thumbs  
var col:Number = 8 // columns amount

Currently, the thumbnails column number is predetermined by the COL variable.  
I came up with this line, which is working, but only in when the movie first loads:

col = Math.round(Stage.width/60)-1;

The result? The thumbnails column number is determined depending on your browser’s width, in order for you not to see a long line of thumbnails loading outside of the screen.

Now…  
I would like to have this behavior to occur when you resize the browser as well.  
I tried to use a StageListener.onResize, which is most likely what will be needed in the end. However, it is not that simple. I think it is because the thumbnails are loaded dynamically from an XML file, so they are stuck with the initial column number. I don’t know how to achieve this. Any idea?

On good working example is:  
[COLOR=Blue][www.milesaldridge.com](http://milesaldridge.com)[/COLOR]  
in the portfolio section
