Using XML in an array.

  • stern1001
  • Born
  • Born
  • stern1001
  • Posts: 1

Post 3+ Months Ago

Hello everybody,

I found your forum cause I was searching for some quick help with some actionscript. I really need this so I would be happy if someone could help such a novice like me... :oops:

Ok, I'm going to explain my problem. I have an easy xml-file with some menu items in. Now I want to pass this xmlnodes to an array where i can use them to build a menu... Perhaps you look in the attached file, which is commented and you will understand. Hope so.

I posted already at some other place, but no one helped me. So your my last hope.

Thank you very much.

File: http://www.loaditup.de/161256.html

Regards
Stern
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Code: [ Select ]
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
    if (success) {
        var myArray = my_xml.firstChild.childNodes;
        // your xml file is now an array
    } else {
        trace("Error Loading XML");
    }
};
my_xml.load("xmlFile.xml");
  1. var my_xml = new XML();
  2. my_xml.ignoreWhite = true;
  3. my_xml.onLoad = function(success) {
  4.     if (success) {
  5.         var myArray = my_xml.firstChild.childNodes;
  6.         // your xml file is now an array
  7.     } else {
  8.         trace("Error Loading XML");
  9.     }
  10. };
  11. my_xml.load("xmlFile.xml");


More help from Kirupa: http://www.kirupa.com/web/xml/index.htm

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.