# Looping photo gallery to the beginning

**URL:** <https://forum.kirupa.com/t/looping-photo-gallery-to-the-beginning/304719>\
**Category:** flash\
**Created:** [February 12, 2010, 1:57pm UTC](https://forum.kirupa.com/t/looping-photo-gallery-to-the-beginning/304719 "2010-02-12T13:57:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![illustr8r](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@illustr8r](https://forum.kirupa.com/u/illustr8r)\
**Post date:** [February 12, 2010, 1:57pm UTC](https://forum.kirupa.com/t/looping-photo-gallery-to-the-beginning/304719/1 "2010-02-12T13:57:12Z")

</div>

I used this tutorial to create an xml photo gallery:

[http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery.htm](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm)

I would like to add the functionality of having the next button return to the beginning of the xml when you reach the end and have the previous button return to the end if you are navigating the other way. Any ideas?
