Feb
11
2009
Weird Loader event error after declaring RSS XML namespace
Can`t really get my head around this, I`ve used a code snippet from an Adobe RSS reader example to sort the namespace of an RSS feed:
if (rssXML.namespace("") != undefined)
{
default xml namespace = rssXML.namespace("");
}
Then tried to load an image using a URL from it with a listener for load completion:
var ldr:Loader = new Loader()
var url:String = item.enclosure.@url;
var urlReq:URLRequest = new URLRequest(url);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete)
ldr.load(urlReq);
contentHolder.addChild(ldr);>
public function onLoadComplete(event:Event):void
{
trace(event)
}
But this kept on throwing me an annoying error:
ReferenceError: Error #1069: Property namespace not found on flash.events.Event and there is no default value.
Only solution was commenting out the namespace bit. It might work with a different namespace declaration, but not with this, so beware