A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Targeting XML values

  1. #1
    imagination through stupidity
    Join Date
    Apr 2001
    Location
    P3X-3113
    Posts
    1,238
    here is the xml code..

    <?xml version="1.0" ?>
    navigation>
    icon1>
    title>Company/title>
    /icon1>
    icon2>
    title>Profile/title>
    /icon2>
    icon3>
    title>Work/title>
    /icon3>
    icon4>
    title>Awards/title>
    /icon4>
    icon5>
    title>Lab/title>
    /icon5>
    icon6>
    title>Settings/title>
    /icon6>
    icon7>
    title>Recycle/title>
    /icon7>
    /navigation>
    << missing the < so it will appear on the board..

    in flash i can put..

    // ==========================================
    navdata = new XML();
    navdata.load("nav.xml");
    navlist = new Array();
    function myOnLoad () {
    _root.window5.icon_name = navdata.firstChild.firstChild.firstChild.firstChil d.nodeValue;
    _root.window4.icon_name = navdata.firstChild.firstChild.nextSibling.firstChi ld.firstChild.nodeValue;
    _root.window1.icon_name = navdata.firstChild.firstChild.nextSibling.firstChi ld.nodeValue;
    _root.window3.icon_name = navdata.firstChild.firstChild.nextSibling.nodeName ;
    _root.window2.icon_name = navdata.firstChild.firstChild.nextSibling.nodeName ;
    _root.window7.icon_name = navdata.firstChild.firstChild.nextSibling.nodeName ;
    _root.window6.icon_name = navdata.firstChild.firstChild.nextSibling.nodeName ;
    }
    navdata.onLoad = myOnLoad;
    stop ();

    but this only gets the first 2 variables successfully..

    i don't completeley understand the firstChild and nextSibling stuff..

    thank you for any help..
    [Edited by Sybersnake on 10-01-2001 at 06:52 PM]

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    I'm going to be posting some Open Source stuff in the next 3 days... it'll help you understand what's going on...

    I'd recommend using childNodes instead of firstChild/nextSibling... it's a bit different, but easier to use and understand.

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