I believe you are trying to do too much outside of a function.  The variable initialize lines are ok, but do the real work inside of a function called by an event, say creationComplete.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Kyle
Sent: Tuesday, August 29, 2006 12:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Having trouble with basic xml loading...

 

Hello all,
I am a somewhat seasoned veteran in Flash, but am finding myself
having a lot of trouble with Flex. I am trying to do a simple XML load
from an external file and am running into a lot of errors. The two
reported errors are:

1) Access of undefined property myLoader
2) Access of undefined property xmlLoaded

Any help that anyone can provide, or any links to some simply flex2
xml loading tutorials would be greatly appreciated!

Thanks,

Kyle

My complete mxml code looks is as follows:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">

<mx:Script>
<![CDATA[
import flash.net.*;
import flash.events.*;

var myXML:XML = new XML();
var XML_URL:String = "order.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete" ,xmlLoaded);

function xmlLoaded(evtObj:Event) {
myXML = XML(myLoader.data);
trace("Data loaded.");
}
]]>
</mx:Script>

</mx:Application>

<!---------------------------------------------------------->

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to