PDA

View Full Version : Dynamic image caption positioning


jason000
03-29-2004, 01:16 PM
I have a Flash slideshow that pulls the image information from an XML file. You've probably seen these all over the place. Anyway, what I'd like to do is make the text accompanying the image to appear below or to the side of an image depending on the image dimensions. For example, if the image is vertical the flash file should be smart enough to put the caption to the right. On the otherhand, if I have a wide horizontal shot the caption would appear below it. Sounds pretty simple, but I'm not sure how to do this. Anyone seen a good tutorial or know of an easy way to automate this?

Slowburn
03-29-2004, 05:21 PM
just use if statements:

if (width >= some width) {
then put horizontally;
} else {
put vertically;
}

You'll just have to know what the max size is for a thin and wide image. then you can use those in the if function

jason000
03-29-2004, 11:32 PM
Thanks, I'll give it try.