# General Logic for Playlist help

**URL:** <https://forum.kirupa.com/t/general-logic-for-playlist-help/246886>\
**Category:** flash\
**Created:** [December 15, 2007, 10:40pm UTC](https://forum.kirupa.com/t/general-logic-for-playlist-help/246886 "2007-12-15T22:40:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbd](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@kbd](https://forum.kirupa.com/u/kbd)\
**Post date:** [December 15, 2007, 10:40pm UTC](https://forum.kirupa.com/t/general-logic-for-playlist-help/246886/1 "2007-12-15T22:40:20Z")

</div>

Hello,  
I’m really stumped.  
I have a movie that has two text fields on screen, A next button, a Previous button and a dynamically generated playlist. Everything is being populated by an XML document.

The next/previous buttons cycle through the XML document and populate the text fields accordingly. The buttons in the playlist populate the textfields when clicked. No problems there.

The problem is when I select an item from the playlist, then try to use the NEXT/PREVIOUS buttons.  
The function that initially populates the text checks for a variable that sets the index position to 0. So whenever I select an item from the playlist, then click on the NEXT button it is looking for the last position set by the NEXT/PREVIOUS buttons. Not the position set by the playlist item.

I’m not sure exactly sure what needs to occur once a playlist item is selected, so that playlist item is also triggered by the NEXT & PREVIOUS buttons. Here is an example of what I am trying to achieve :[http://www.msnbc.msn.com/id/21134540/vp/22272408#22259436](http://www.msnbc.msn.com/id/21134540/vp/22272408#22259436)  
If you click the next&previous buttons it cycles through on the playlist etc. etc. ( I love how this example kicks out 90 million errors too…)

Sorry if this sounds confusing. I’m like a caveman trying to fly a spaceship when it comes to programming. Any help would be greatly appreciated.
