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.


  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1825
  • 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");
  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:

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 5 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

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