XML/flashMX ??

Out of context: Reply #13

  • Started
  • Last post
  • 24 Responses
  • heavyt0

    this is my actionscript.
    can you see any problems with it?

    //creates a new XML Object

    pricedata = new XML();

    // loads the local file prices.xml into the object and parses it

    pricedata.load("pricesfordc.xml...

    // creates new array to place the "tree" of the xml file into
    pricelist = new Array;

    // function to test if file is loaded before it navigates the tree;

    function myOnLoad () {
    pricelist = pricedata.firstChild.childNodes;

    //returns length of array to be sure I read it correctly.

    testVarLength = pricelist.length;
    //array
    Var = pricelist [0].firstChild.nodeValue;
    Var2 = pricelist [1].firstChild.nodeValue;
    Var3 = pricelist [2].firstChild.nodeValue;
    Var4 = pricelist [3].firstChild.nodeValue;
    Var5 = pricelist [4].firstChild.nodeValue;
    Var6 = pricelist [5].firstChild.nodeValue;

    }

    //keeps "calling" to see if the file is done loading, and runs function when done

    pricedata.onLoad = myOnLoad;

View thread