Load problem... i guess

Hi there…
I am trying to load a list from a xml file to a flash listbox that is on the net.
For some reason, i am not able to populate the same listbox, while at home i can using instead of a http address the local c: drive and the flash running on my computer.
I am using the following code:


var food_xml = new XML();
food_xml.load("http//..../xml/food_list.xml");
the food_list.xml is 49kb.

When i click, load food button on my flash application, it just shows:
undefined

I am pretty sure about ALL the address given… Do i need to “preload” the file and THEN populate the listbox?
Any ideas? Clues? Hints?
Thanks.
Leo.
:hugegrin:

You should probably run the population function in a call from the XML.onLoad function, that way the only way that the ListBox contents can be assigned is when the XML has been loaded.


var food_list = new XML();
food_list.load("[www.....food_list.xml](http://www.....food_list.xml)");

food_list.onLoad =  function(success)
{
 
 if (success) 
 {  
 
.... do my stuff 
 } 
 else 
 {
...... didnt work
 }
}  

 
function food(c)
{
.... display the food...
 

}
 

Are u talking about something like the previous one?
that is the “way” i am doing it…
Any idea?
Thanks.
Leo

Do you know if you’re making it into the onLoad function at all? You can try putting a trace inside the success and failure branches to see…

also is the xml file url you’re loading in the same domain as the place where the flash movie is running? Flash can’t do a cross-domain xml file load without a policy file in place.

HEY THATS IT !
I put the xml in one folder and the flash (swf) in another!
I will correct that.
THANKS SO MUCH!:thumb2:
Cheers!
Leo.