Unless I’m missing something, you could use a <mx:Model source=”xmlFile.xml”> and use onComplete events…or if it’s in a url, use a HttpService to call it in. Here’s what I’d do:

<mx:HttpService url="" result=”trace(result.toXMLstring());”/>

 

_________________________________________

Jonathan Miranda

Flexible Master of the Web

"In the game of chess, it's important to never let your opponent see your pieces."

HealthGrades: Guiding America to Better Healthcare™

NASDAQ: HGRD

w  (720) 963-3832

c  (707) 761-0868

[EMAIL PROTECTED]

_________________________________________

The message contains confidential and/or legally privileged information and is intended for use only by the indicated addressee.  If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of revanisle
Sent: Monday, February 27, 2006 12:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Newbie: load external xml problem

 

Hi all,
  I'm new to Flex and AS3 (well, I guess everyone's "new" to AS3) and
am having difficulty with what should be basic and simple - loading an
external xml file.  I can't even get the examples in Help to work
(Flex 2beta):

1 var externalXML:XML;
2 var loader:URLLoader = new URLLoader();
3 var request:URLRequest = new URLRequest("xmlFile.xml");
4 loader.load(request);
5 loader.addEventListener(EventType.COMPLETE, onComplete);
6
7 function onComplete(event:Event):Void{
8     var loader:URLLoader = URLLoader(event.target);
9     externalXML = new XML(loader.data);
10    trace(externalXML.toXMLString());
11 }

This gives me an error at line 7 - Void is not a compile time constant.
If I change that to lowercase void (or any other valid constant) or
remove the type declaration :Void altogether I get two errors at lines
4 and 5 telling me that "request" and "loader" are undefined
properties, even though they're defined immediately above.  What
gives?  and thanks in advance for your help!

Rick Englert







--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to