PDA

View Full Version : [AS3] slow retreive when using URLRequest to RSSFeed


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

DukeW
07-13-2009, 09:20 PM
Never ran in to such a problem, and I've spent a few years developing Flash apps for desktops. I can think of two possible workarounds, one is nice(try using Adobe AIR), and the other is a bit messy, though from time to time much better. Try opening it in IE, if it works fine from there, that means that it works fine with the OCX version of FP. OCX files aka ActiveX files can be used in a great variety of other programing languages (All VS environments, Delphi, etc), so practically you can make your projector.