# Retrieving value in flash from xml file

**URL:** <https://forum.kirupa.com/t/retrieving-value-in-flash-from-xml-file/228909>\
**Category:** Uncategorized\
**Created:** [June 12, 2007, 2:11pm UTC](https://forum.kirupa.com/t/retrieving-value-in-flash-from-xml-file/228909 "2007-06-12T14:11:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Birchwood](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@Birchwood](https://forum.kirupa.com/u/Birchwood)\
**Post date:** [June 12, 2007, 2:11pm UTC](https://forum.kirupa.com/t/retrieving-value-in-flash-from-xml-file/228909/1 "2007-06-12T14:11:43Z")

</div>

**[COLOR=Red]Edit: By value i mean a number that is in my xml file.[/COLOR]**

This is probably a very simple problem, but i’ve been working with this problem a few days now. I really suck at Actionscript, thats probably why.

Well, I want to retrieve a value from a xml file and put it into a variable outside the onLoad function. Somehow i can trace movieIds inside the onLoad function but not outside it.  
Here is the code:

var playlist\_xml = new XML();  
playlist\_xml.ignoreWhite = true;  
playlist\_xml.onLoad = function(success) {  
if (success){  
Ids = playlist\_xml.firstChild.childNodes;  
movieIds = Ids[0].firstChild.nodeValue;  
}else trace(“Error loading XML file”); // no success? trace error (wont be seen on web)  
trace(movieIds);  
}  
playlist\_xml.load(“c://movieid.xml”);

TESTING\_ID = movieIds; // Somehow movieIds never gets into var TESTING\_ID

I hope you understand my problem.

Greetings.
