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[c])});
clips_list.addItem({source:String(clipsXml.clip[c])});
trace(clipsXml);
}
trace(clips);
//clips_list.dataProvider = new DataProvider(clipsArray);
}
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[c].text())});
}
}
this Line not works in loop
clips_list.addItem({source:String(clipsXml.clip[c])});
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
North America
Europe, Middle East and Africa
Asia Pacific