View Full Version : XML driven thumbnail menu

11-18-2006, 12:59 AM
I'm working on a flash (v8) file that loads an xml file and generates x amount of image thumbnail buttons on the stage in a horizontal row. They get their own consecutive instance names and depth.

Currently it's very easy to add/remove items via the xml file but when I add more than x objects (in this case it's 6) I want to to create a new row and spit out the next 6 and so on rather than just continuing on and going right off the stage.

I was thinking of possibly nested IF statements within the while loop checking either current value of i or the thumbnails x position and then changing the x, y values accordingly but this by no means efficient code.

I'm a programming noob. This is probably a simple, common programming solution but if anyone has any help it would be much appreciated.


11-18-2006, 08:02 AM
The easy way would be to set up an array, and like you said, check the value of i. If i >=6 then move to array2, etc.

Or you could set up "invisible" clip containers, and fill them based on the number of i.

Depends on your look and feel and what you want.

The array method will be more eye pleasing, the container method will be less coding.