Thumbnails: reorganize them on browser resize?

Using an XML generated gallery, I would like to add the feature of repositioning the dynamically loaded thumbnails when the browser is resized. Currently, the thumbnails are laid out in columns and row, the number of column being predetermined by a COL variable. The rest of the code distributes the thumbs into as many rows as necessary depending on the COL number and total thumbs number. I came up with this line, which seems to be a good start:

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

However, it is only working when the movie first loads. I tried putting a stageListener, onResize… but still not working. I guess it has to do with the XML…

On good working example is:
in the portfolio section