A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] XML Parsing

  1. #1
    Member
    Join Date
    Nov 2003
    Location
    Ontario, Canada
    Posts
    80

    [F8] XML Parsing

    How might I store somthign like this in an array?
    <event date="4" name="On Campus" text="Look for Zeta Psi Brothers on campus with their blue shirts. 11-3pm">

    If the XML is filled with these, on for whatever day of that month.

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    depends on what you want, be more specific

  3. #3
    Member
    Join Date
    Nov 2003
    Location
    Ontario, Canada
    Posts
    80
    Ill have an 2d array Called Event List so:

    eventList = new Array([date,name,text],[date,name,text],[date,name,text]...) for all the event listed in the XML File.

  4. #4
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    like this:
    PHP Code:
    var eventList = new Array();

    var 
    node xmlLoaded.firstChild.childNodes;
    for (
    i=0;i<node.length;i++){

        var 
    obj = new Object();//create temporary object to store data
        
    obj.date node[i].attributes.date;//read xml childNode i with attributes...
        
    obj.name node[i].attributes.name;
        
    obj.text node[i].attributes.text;

        
    eventList.push(obj);//add temporary object to array


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center