# Error opening URL file:// undefined? can't see what I missed

**URL:** <https://forum.kirupa.com/t/error-opening-url-file-undefined-cant-see-what-i-missed/254363>\
**Category:** Uncategorized\
**Created:** [March 11, 2008, 10:44am UTC](https://forum.kirupa.com/t/error-opening-url-file-undefined-cant-see-what-i-missed/254363 "2008-03-11T10:44:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y0UNG5T4](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Y0UNG5T4](https://forum.kirupa.com/u/Y0UNG5T4)\
**Post date:** [March 11, 2008, 10:44am UTC](https://forum.kirupa.com/t/error-opening-url-file-undefined-cant-see-what-i-missed/254363/1 "2008-03-11T10:44:03Z")

</div>

I am using a dynamic nav menu edited using xml, when the corresponding button is pressed I want it to display some text in the text box and load a .swf into the loader m.c. It sort of works, however which ever button i click on it displays the content text and .swf for the last button listed in the xml file, when I try to set a var equal to the instance name of the button clicked on it shows the text as undefined and does not load the m.c? If i leave out the var ‘currentIndex’ I get a message in the output Error opening URL file undefined. I’ve checked everything and there are no typos. Really need some help here.

Thanks

code;

var yPosition:Number = 0;

var myXML:XML = new XML();  
myXML.ignoreWhite = true;

var links:Array = new Array();  
var names:Array = new Array();  
theText.\_alpha = 0;  
empty.\_visible = false;

myXML.onLoad = function(){

```
var linkname:Array = this.firstChild.childNodes;

for(i=0;i&lt;linkname.length;i++){

    names.push(linkname*.attributes.NAME);
    contents = linkname*.attributes.CONTENT;
    movies = linkname*.attributes.MOVIE;
    
    _root.attachMovie("button","btn"+i,_root.getNextHighestDepth());
    _root["btn"+i]._y = yPosition;
    yPosition = yPosition + 25
    _root["btn"+(i)].blackTxt.Txt.text = (names*);
    _root["btn"+(i)].whiteTxt.Txt.text = (names*);
    _root["btn"+(i)].onRollOver = btnOver;
    _root["btn"+(i)].onRollOut = btnOut;
    _root["btn"+(i)].onRelease = btnRelease;
}

```

}

myXML.load(“projects.xml”);

function btnOver(){

```
this.gotoAndPlay(2);

```

}

function btnOut(){

```
this.gotoAndPlay(11);

```

}

function btnRelease(){

```
var currentBtn:String = this._name;
var currentIndex:String = currentBtn.substring(3,5);
theText._alpha = 100;
theText.text = contents;
empty._visible = true;
empty.loadMovie(movies[currentIndex]);

```

}
