Skip navigation
Currently Being Moderated

tilelist and xml

May 7, 2012 8:34 AM

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);
}
 
Replies
  • Currently Being Moderated
    May 7, 2012 9:03 AM   in reply to tripleA999

    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())});
        }
    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 3:39 AM   in reply to tripleA999

    clipsXml.length() gives only 1. Thats your loop is not executed. First retrieve your nodes length in xml file then you get the output.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points