# \[AS2\] Returning getSelectedItem().label in a list component?

**URL:** <https://forum.kirupa.com/t/as2-returning-getselecteditem-label-in-a-list-component/282939>\
**Category:** flash\
**Created:** [February 27, 2009, 11:42pm UTC](https://forum.kirupa.com/t/as2-returning-getselecteditem-label-in-a-list-component/282939 "2009-02-27T23:42:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lurker](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Lurker](https://forum.kirupa.com/u/Lurker)\
**Post date:** [February 27, 2009, 11:42pm UTC](https://forum.kirupa.com/t/as2-returning-getselecteditem-label-in-a-list-component/282939/1 "2009-02-27T23:42:20Z")

</div>

Okay, so I have this code:

if (get\_slot() == “Save Slot 1”) {  
function loadXML(loaded) {  
if (loaded) {  
link = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
link.text = link;  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load("/XML/links.xml");  
}

get\_slot() is a function that returns the label of the currently selected item in my list box. Anyway, when I try this code, it says “Error opening URL ‘file:///XML/links.xml’” instead of assuming that XML is a folder containing links.xml that is in the same file as the .swf. It’s worked fine in the past, but now it’s not working at all.
