AS2: dynamic thumbnail sizes

Hi, i’m making a scrolling xml gallery.
Everything is working fine however for the particular design of the site i’m making i need thumbnails that have different widths. Currently i’ve written an xml file that lists the names of the images which are then loaded into a container within a scroller.

Is there a way i can load external images and then write some AS that figures out how wide each thumbnail image is? (i have a feeling i need to write a variable for the widths of the containers but not sure how)

or maybe an easier way of looking at it - does anyone know of an example that loads an array of images sequentially that have different widths but display next to each other?

Thanks ^^

so here’s the problem… Flash doesn’t know the size of externally loaded images until they have loaded all the way in. That usually occurs long after the code to place the images has been processed. So when you come to the point where the code trys to place objects it bases everything on a zero width.

There are two options. You can either load all the content off the stage and then once the images are loaded move them to the correct location on the stage. Or you can add the size values to each node of your xml. Once you know the size (either after the load, or from your xml) you need to loop through the images and create a variable that is essentially the nextX. nextX would be the Current Image X + the Current Image width + a spacer

Make sense?

[quote=graphixboy;2345389]so here’s the problem… Flash doesn’t know the size of externally loaded images until they have loaded all the way in. That usually occurs long after the code to place the images has been processed. So when you come to the point where the code trys to place objects it bases everything on a zero width.

There are two options. You can either load all the content off the stage and then once the images are loaded move them to the correct location on the stage. Or you can add the size values to each node of your xml. Once you know the size (either after the load, or from your xml) you need to loop through the images and create a variable that is essentially the nextX. nextX would be the Current Image X + the Current Image width + a spacer

Make sense?[/quote]

thanks very much, yeah i was thinking they would be my options, i was just hoping for a magical solution hehe.

i’m making the site for non-tech person so i’ll see if they can understand image sizes n add it to the xml.

Cheers for the help!