How to Get "Next" button to load next movie clip from XML?

In my main Flash movie, I have an XML-driven menu that is loading external swf files into a “container” movie clip within the main Flash movie. (I have that part working nicely.)

I want to have “go to next movie” and “go to previous movie” button on the main Flash movie, which would load different external swf files into the container movie clip. My problem is, I don’t know how to tell Flash which external swf file should come “next” or “previous” based on what is selected in the XML-driven menu. It seem like I need to pass a “NextMovie” variable through the XML file to the main Flash movie, and then have a button pick up that “NextMovie” variable and use that as the file name of the next external swf to load… but I don’t know how to make that work.

Anybody have any ideas how I can get these “next” and “previous” buttons knowing which file to load, all from the XML file?

This is what my xml file looks like, in case that helps.

<?xml version=“1.0”?>
<menu name=“menu”>
<item name=“Menu Item 1” action=“gotoLoadMovie” variables=“somemovie.swf”/>
<item name=“Another Item” action=“gotoLoadMovie” variables=“anothermovie.swf”/>
<item name=“Some Other Item” action=“gotoLoadMovie” variables=“yetanothermovie.swf”/>
</menu>

I appreciate any ideas you have. Thanks for reading this post!