swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] XML.load()


From: Chris Pugh
Subject: Re: [Swftools-common] XML.load()
Date: Mon, 24 Nov 2008 11:22:54 +0000

2008/11/24 Matthias Kramm <address@hidden>:
> On Sat, Nov 22, 2008 at 04:50:23AM +0000, Chris Pugh <address@hidden> wrote:
>> Greetings one and all,
>>
>> I'm having no joy whatsoever with ,
>>
>>       var myXML = new XML();
>> //    myXML.ignoreWhite=true;
>>       myXML.load("<relative URL of XML file>");
>
> This works for me, with all flash versions:
>
>        var myXML = new XML();
>        myXML.load("test.xml");
>        myXML.onLoad = function(success){
>            trace("xml:"+myXML);
>        };

This was my first message Mattias, and the issue was incorrectly
stated.  Hence the reason I posted agan, with examples.

      http://www.nordberg.me.uk/swfc_samples/

With,

var myXML = new XML();
myXML.load("test.xml");
myXML.onLoad = function(success){}

I can indeed access the XML data by directly printing myXML.  However,
trying such as,

     myXML.firstChild.firstChild.attributes.name;

on myXML results in 'undefined', rather than the specific chunk of xml
data one is after.

This only seems to happen as the result of a file load with
myXML.load('test.xml').

Loading the XML string directly ( 005.sc/005.swf from my samples ),

    var myXML = "<gallery name=\"gallery\"><artist name=\"Francisco
Goya\"><picture name=\"Maja Naked\">marja_naked.png</picture>
                           <picture name=\"Maja
Clothed\">maja_clothed.png</picture></artist></gallery>";
    var myXML = new XML(galleryXML);
   //
  /// etc, etc

and

        myXML.firstChild.firstChild.attributes.name;

gives the correct response, namely,

      Francisco Goya

Hope you follow?

Regards,


Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]