<?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