OK - thanks Muzak and Jesse, no error now, BUT the text does not appear
in the panel title.

You had suggested:

title="{myXML.day[0].name}"

though no errors, does not appear.  Also:

title="{myXML.data.day[0].name}"

Does not appear either.

And the XML is simply:

<?xml version="1.0"?>
<data>
        <day>
        <name>Monday</name>
        <amount>5</amount>
    </day>
        <day>
        <name>Tuesday</name>
        <amount>7</amount>
    </day>
    <day>
        <name>Wednesday</name>
        <amount>8</amount>
    </day>
</data>

Is it something to do with synchronous loading of the XML?

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com










>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Muzak
>>Sent: Thursday, October 20, 2005 12:34 PM
>>To: Flashcoders mailing list
>>Subject: Re: [Flashcoders] Help with Flexbuilder 2 and XML loading
>>
>><?xml version="1.0"?>
>><mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml";
>>creationComplete="init();">
>>    <mx:Script>
>>        <![CDATA[
>>            import mx.formatters.*;
>>            import flash.net.URLRequest;
>>            import flash.net.URLLoader;
>>            import flash.events.trace;
>>            public var myXML:XML;
>>            public var myXMLURL:URLRequest;
>>
>>            private function init():Void{
>>                myXML = new XML();
>>                myXMLURL = new URLRequest("data.xml");
>>                var myLoader:URLLoader = new URLLoader(myXMLURL);
>>                myLoader.addEventListener("complete", xmlLoaded);
>>            }
>>
>>            private function xmlLoaded(evtObj:Event) {
>>                myXML = XML(evtObj.target.data);
>>                trace(myXML.day[0].name);
>>            }
>>        ]]>
>>    </mx:Script>
>>    <mx:Panel title="{myXML.day[0].name}" width="300" height="200"/>
>></mx:Application>
>>
>>You'll still see a message saying that "changes to blah blah" will not
be detected
>>though.
>>
>>Some things haven't changed --> trace() is still your best friend ;-)
>>
>>regards,
>>Muzak
>>
>>----- Original Message -----
>>From: "Merrill, Jason" <[EMAIL PROTECTED]>
>>To: "Flashcoders mailing list" <[email protected]>
>>Sent: Thursday, October 20, 2005 5:50 PM
>>Subject: RE: [Flashcoders] Help with Flexbuilder 2 and XML loading
>>
>>
>>Yeah, I thought of that and tried that too, and I get a Flash player
8.5
>>error:
>>
>>ReferenceError: Error #1069: Property myXML not found on test1 and
there
>>is no default value
>>
>>
>>
>>_______________________________________________
>>Flashcoders mailing list
>>[email protected]
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
NOTICE:
This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of this e-mail by you 
is prohibited.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to