The xml returned defines it's own namespace:

private function onInit ():void{
                var loader:URLLoader = new URLLoader();
                var request:URLRequest = new URLRequest
("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml");
                loader.addEventListener(Event.COMPLETE,
onComplete);
                loader.load(request);      
            }
           
            private function onComplete (event:Event):void {
             var loader:URLLoader = URLLoader(event.target);
             var externalXML:XML = XML (loader.data);
             var xml_ns:Namespace = externalXML.namespace ("");
             var cubes:XMLList =
externalXML.xml_ns::Cube.xml_ns::Cube.xml_ns::Cube;
             for each (var currency:XML in cubes) {
                  trace ([EMAIL PROTECTED]);
             }
            }

--- In flexcoders@yahoogroups.com, Jesús Iglesias <[EMAIL PROTECTED]> wrote:
>
> Hi,
> This is my code on F2b3. I load the "Euro foreign exchange
reference
> rates" from http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml.
> It seems like all is fine but nothing happens. XML is well
received,
> Alert.show(externalXML.toXMLString()) shows the xml, but then the
> processing seems to fail whithout no error.
> Does anybody know way?

> private function onInit():void{
>     var loader:URLLoader = new URLLoader();
>     var request:URLRequest = new
> URLRequest("http://www.ecb.int/stats/eurofxref/eurofxref-
daily.xml");
>     loader.addEventListener(Event.COMPLETE, onComplete);
>     loader.load(request);      
> }

> private function onComplete(event:Event):void {
>        var loader:URLLoader = URLLoader(event.target);
>        externalXML = new XML(loader.data);
>        for each (var currency:XML in externalXML.Cube.Cube.Cube) {
>             Alert.show([EMAIL PROTECTED]);
>        }
> }

> thanks.





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