Copy link to clipboard
Copied
I am unable to load pics from xml to TileList
I tried to add through Array & addItem , but both are not working
below is code , when xml is loaded
function clipsXmlLoaded(event:Event):void
{
clipsXml = XML(clipxmlLoader.data);
trace(clipsXml);
for(var c:int = 0; c<clipsXml.length ; c++ )
{
//clipsArray.push ({label:"" , source:String(clipsXml.clip
)}); clips_list.addItem({source:String(clipsXml.clip
)}); trace(clipsXml);
}
trace("clips");
//clips_list.dataProvider = new DataProvider(clipsArray);
}
clipsXml.length() gives only 1. Thats your loop is not executed. First retrieve your nodes length in xml file then you get the output.
Copy link to clipboard
Copied
The Array class is not the same as the XML class. You might need to revise your code to agree with the methods of the XML class. You seem to be using them as properties. Try...
function clipsXmlLoaded(event:Event):void
{
clipsXml = XML(clipxmlLoader.data);
for(var c:int = 0; c<clipsXml.length(); c++ )
{
clips_list.addItem({source:String(clipsXml.clip
}
}
Copy link to clipboard
Copied
this Line not works in loop
clips_list.addItem({source:String(clipsXml.clip
but when I use outside the loop IT WORKS like this :
clips_list.addItem({source:String(clipsXml.clip[1])});
clips_list.addItem({source:String(clipsXml.clip[2])});
clips_list.addItem({source:String(clipsXml.clip[3])});
loop is not working , but it tracing path also fine
Copy link to clipboard
Copied
clipsXml.length() gives only 1. Thats your loop is not executed. First retrieve your nodes length in xml file then you get the output.
Copy link to clipboard
Copied
somtime Minor error creates so much time wast