2 Replies Latest reply on Mar 27, 2007 12:44 PM by Midwest_Mandy

    XML converting to AS array trouble

      I’m working on this project and the company I work for doesn’t support XML. I have this flash file that I didn’t write that I'm trying to convert the xml over to AS. My problem is I don’t seem to be able to duplicate the array. I want the array data to be written the same as if it came from an XML document because this array is connected to a lot of other things that I really don’t want to go in and mess with. The original code looks like this the following code. Does any one know how I could convert it back to AS? Thanks for any help. :)

        • 1. Re: XML converting to AS array trouble
          liquidleaf Level 1
          Seems to me that you'd just need pseudoRoot.contentArray to be an array of all the filenames. All of that extra code is to pull the filename out of the XML. The code you show only push()es the filenames alone to the content array. There is some other code in case <param .. /> is encountered, but in the XML you gave, there are no <param />s anyway.

          So, unless I'm mistaken, the following should work:

          pseudoRoot.contentArray = ["cover.jpg", "coverinside.jpg", "page01.jpg" ..... ];
          (of course insert the rest of the jpgs in there).
          • 2. Re: XML converting to AS array trouble
            Midwest_Mandy Level 1
            Thanks! I came up with the same thing. I was coming back to forum to let everyone know I figured it out. Then I saw your post and you came up with the same thing I did. But of course you solved it in about five minutes, I've been working on for the past hour or so. Thanks again. :)