k_c2009
07-02-2009, 05:29 PM
Hi all,
I am making a RSS reader that sits on a local machine and I am using the following class to retrieve an XML file or (any RSS Feed in the future), it works perfect and takes no time to load up the required feed within the authoring environment, but it takes noticeably longer (4 seconds) as soon as I turn it into a projector, does anyone has any idea please?
this class is for a movieclip that sits on stage:
____________________
public class TestXML extends MovieClip{
private var _xml:XML
private var _loader:URLLoader
function TestXML(){
loadXMLFeed()
}
private function loadXMLFeed():void{
_loader=new URLLoader()
_loader.addEventListener(Event.COMPLETE, onFeedLoaded)
_loader.addEventListener(IOErrorEvent.IO_ERROR,onI OError)
_loader.load(new URLRequest('http://www.telegraph.co.uk/sport/rss'))
}
private function onFeedLoaded(e:Event):void{
var data:XML=XML(e.target.data)
this.txt.text=data.toString()
}
private function onIOError(e:IOErrorEvent):void{
trace(e)
}
}
Thanks in advance
Ken
I am making a RSS reader that sits on a local machine and I am using the following class to retrieve an XML file or (any RSS Feed in the future), it works perfect and takes no time to load up the required feed within the authoring environment, but it takes noticeably longer (4 seconds) as soon as I turn it into a projector, does anyone has any idea please?
this class is for a movieclip that sits on stage:
____________________
public class TestXML extends MovieClip{
private var _xml:XML
private var _loader:URLLoader
function TestXML(){
loadXMLFeed()
}
private function loadXMLFeed():void{
_loader=new URLLoader()
_loader.addEventListener(Event.COMPLETE, onFeedLoaded)
_loader.addEventListener(IOErrorEvent.IO_ERROR,onI OError)
_loader.load(new URLRequest('http://www.telegraph.co.uk/sport/rss'))
}
private function onFeedLoaded(e:Event):void{
var data:XML=XML(e.target.data)
this.txt.text=data.toString()
}
private function onIOError(e:IOErrorEvent):void{
trace(e)
}
}
Thanks in advance
Ken