View Full Version : need help with XML photogallery & scrolling thumbnails
usr3712
04-20-2005, 03:17 PM
I have an XML photogallery that reads a directory of thumbnails. These thumbnails get placed in a scrolling movieclip.
Does anyone know how I can determine the total length of the thumbs so the scrolling movieclip knows when to stop (x position) based on the number of thumbnail images? So for example, if I add/subtract thumbs the scrolling clip adjusts its scrolling x position accordingly?
Thanks for the help!!
Jozzle
04-20-2005, 03:30 PM
Hi,
The scrollPane component does that automatically...
You can count the number of thumbnail elements in your XML.
Assuming your XML is something like:<thumbnails>
<img id="1" url="pic1.jpg" />
<img id="2" url="pic2.jpg" />
<img id="3" url="pic3.jpg" />
<img id="4" url="pic4.jpg" />
</thumbnails>Then this:trace("number of thumbnails = " + your_xml_object.firstChild.childNodes.length);will trace the number of thumbnail elements.
usr3712
04-20-2005, 08:31 PM
Can you give me a brief overview how to incorprate XML data into a scrollPane?
Jozzle
04-21-2005, 08:03 AM
Sure, here's how i did it...
I have a main swf (container) in wich i placed the scrollPane component and load the XML. When the XML has loaded i load another swf into that scrollPane, containing one object (like your thumb) and script wich retrieves the data loaded by the _root swf (the container). Dependig on the data, i duplicate the thumb object, and the scrollPane sizes accordingly.
I hope this make any sense?
Good luck!
Jozzle
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.