Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

+ Reply to Thread
Results 1 to 2 of 2

Thread: help xml to actionscript 2

  1. #1

    Default help xml to actionscript 2

    Please help problem with the XML with flash to show images next to the text and solve mathematical equations and Unhide a table

  2. #2

    Default

    var dots:XML = new XML();
    dots.load('bigdot.xml');

    dots.onLoad = function(success:Boolean){
    if(success){
    if(dots.status == 0){
    var dotsToXMLString:String = new String(); // initializes a new string variable
    dotsToXMLString = dots.toString(); // converts dots XML object to a string and stores it in dotsToXMLString.

    var dotsXML:XML = new XML(dotsToXMLString);// creates new XML object with the string contents from above.
    dotsXML.par***ML(dotsToXMLString); // parses the string from above.

    var dotsNodes:Object = dotsXML.firstChild; // Saves the firstChild (in this case, the outermost element) as an object
    var dotsNodesChildren:Object = dotsNodes.childNodes; // Saves the childNodes of firstChild as an object

    for(i=0;i<dotsNodesChildren.length;i++){
    var newObj:Object = dotsNodes.childNodes[i].attributes.id; // creates a new object out of the child node's id.

    var newObjColor:Color = new Color(newObj); // creates a new color object with newObj as its target
    var theColor:Number = dotsNodes.childNodes[i].attributes.color; //retrieves the hex code value (number) of the attribute color

    newObjColor.setRGB(theColor); // sets the RGB value of newObjColor.
    }

    } else {
    trace("Problem parsing XML.");
    }
    } else{
    trace("Could not load XML");
    }
    }
    [URL="http://membershipmanager.com/"]web based membership software[/URL]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

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