AS3 XML numbered image gallery

How would I go about dynamically listing the number of xml images within my slideshow and have them clickable to go to the corresponding image?

An example of what I am looking to accomplish:
At least for the numbered thumbs at the bottom…

If anyone has a starting point for this I would greatly appreciate it.