XML Links in AS2 Dynamic Buttons

Hey Guys, first post… hopefully joining this forum may be an awesome resource for future continued use. So, I have an as2 language selection front door in development utilizing xml influenced dynamic buttons being retrofitted for a global front door language toggle.

In production, it looks somewhat like this:

I have two main buttons that the ‘for-loops’ add. mainTabs and subTabs. On release on the subTabs, the are supposed to getURL defined by the link attribute in the xml file. However, I cant seem to have the getURL command target the proper address.

Example Piece of XML:

<topics>
  <topic label="Canada"></topic>
  <topic label="Greenland"></topic>
<topic label="USA">
    <subtopic label="English" link="ENGLISHURL" />
    <subtopic label="Espanol" link="ESPANOLURL" />
  </topic>
  
</topics>

And here is the important parts of the code that have to do with making the on click function work as nessisary. unfortunately, it doesnt. I’m missing the element that tells the getURL where to find the url it needs to get.
Look for the magic happends here flag for quick reference.


var mainTab:Array = new Array();
var subTabArr:Array = new Array();
var total:Number = 0;
var menuXml:XML = new XML();
menuXml.ignoreWhite = true;
mask_clip._visible=0
function xmlLoaded(sucess) {
    init();
    if (sucess) {
        var rootNode = this.firstChild;
        total = rootNode.childNodes.length;
        var count:Number = 0;
        var subcount:Number = 0;
        
        
        for (thisNode=rootNode.firstChild; thisNode != null; thisNode=thisNode.nextSibling) {
            mainTab[count] = thisNode.attributes.label;
            subcount = 0;
            subTabArr[count] = new Array();
            for (subNode=thisNode.firstChild; subNode != null; subNode=subNode.nextSibling) {
                subTabArr[count][subcount] = subNode.attributes.label;
                subcount++;
            }
            
            
            count++;
        }
        createTabMenu();
    } else {
        trace("Failed to load Xml");
    }
}
menuXml.onLoad = xmlLoaded;
menuXml.load("northamerica.xml");


function createTabMenu(){
    _root.Scroll_visible(false);
    this.createEmptyMovieClip("menuTab",1);
    menuTab.setMask(_root.mask_clip)
    menuTab._x = 0;
    x=menuTab._y = 0;
    for(i=0; i<total; i++){
        var tab = menuTab.attachMovie("mainTab","mainTab"+i,i,{_y:i*22});
        tab.label_txt.text = mainTab*;
        tab.a=i;
        tab.open = false;

        tab.over_btn.onRelease = function()
        {
            if(menuTab._height<=mask_clip._height)
            {   
                menuTab._y=x
                _root.ScrollBar._visible=0
            }
            else
            {
                _root.ScrollBar._visible=1
            
            }
            
        }
        tab.over_btn.onPress = function()
        {
            ScrollBar.targetMc=menuTab
            var currNum = this._parent.a;

            if(this._parent.open==false){
                this._parent.open=true;
                for(j=0;j<subTabArr[currNum].length;j++){
                    var subTab = this._parent.attachMovie("subTab","subTab"+j,j,{_y:j*22+22});
                    subTab.label_txt.text = subTabArr[currNum][j];
                    //////////////////////  Magic Happends here //////////
                    subTab.over_btn.onPress = function()
                    { 
                        getURL(this._parent.attributes.link, "_blank");
                    }
                    //////////////////////
                }
            
                for(k=currNum+1; k<total; k++){
                    menuTab["mainTab"+k]._y=menuTab["mainTab"+(k-1)]._y+menuTab["mainTab"+(k-1)]._height;
                }
                if(menuTab._height<=mask_clip._height)
                {     
                _root.Scroll_visible(false);
                    menuTab._y=x
                }else{   
                    _root.Scroll_visible(true);
                }
            }
            else
            {
                this._parent.open=false;
                for(j=0;j<subTabArr[currNum].length;j++){
                    removeMovieClip(menuTab["mainTab"+currNum]["subTab"+j]);
                }
                for(k=currNum+1; k<total; k++){
                    menuTab["mainTab"+k]._y=menuTab["mainTab"+(k-1)]._y+menuTab["mainTab"+(k-1)]._height;
                    if(menuTab._height<=mask_clip._height)
                { 
                    _root.Scroll_visible(false);
                    menuTab._y=x
                    }else{
                    _root.Scroll_visible(true);
                
                }
                }

            }
        }
    }
}

Any help would be greatly appreciated. I hate retrofitting…sigh