I have a simple XML file that has a list of names and I need two buttons. One that simply shows the next mane and the other to show the next name that begins with a different letter. Now I can scroll through the list just fine. However I am having issues with skipping to the next name beginning with a different letter. For example if the list contained these three names; Brian, Bill and Ted I need to skip from Brian to Ted in one click.

This is the code I have so far, but for whatever reason it is skipping to the last letter in the list no matter what letter you are on currently.

PHP Code:
currentLetter _root.nameXML.firstChild.childNodes[tempNum].attributes.name.charAt(0);
for (
r=0r<=_root.nameXML.firstChild.childNodes.length-1r++) {
    if (
currentLetter != _root.irCodeXML.firstChild.childNodes[r].attributes.name.charAt(0)) {
        
mRDevice_txt _root.irCodeXML.firstChild.childNodes[r].attributes.name;
    }

I am by no means and expert at flash so any help would be greatly appreciated.