views:

64

answers:

1

Hi Everyone, I thought this problem may be due to some strange path issue; however, the path is not relative in this case.

I have an AS3 based rss aggregator. It works in flash when I test the movie clip; however, when I place this on the server it no longer works...

I used "taLog.htmlText = "Start";" and similar strings to test where it stops. I suppose that the rssLoaded event never gets called, which means the feed isn't getting loaded, which is strange since it works fine else where....

var rssLoader:URLLoader = new URLLoader();  
var rssURL:URLRequest = new URLRequest("http://www.rssfeedblahblah.com");  
rssLoader.addEventListener(Event.COMPLETE, rssLoaded);  
rssLoader.load(rssURL); 
taLog.htmlText = "Start";  
var rssXML:XML = new XML();  
rssXML.ignoreWhitespace = true;  

function rssLoaded(evt:Event):void{  
 taLog.htmlText = "Loaded";  
 rssXML=XML(rssLoader.data);  
 taLog.htmlText = rssXML;  

 for(var item:String in rssXML.channel.item) {  
  liLog.addItem({label:rssXML.channel.item[item].title})  
 }  
}

function selectLog(evt:Event):void {  
 taLog.htmlText = rssXML.channel.item[ evt.target.selectedIndex ].description;  
}  

liLog.addEventListener(Event.CHANGE, selectLog);
A: 

Are you sure it's not securityError? Listen for io error and security error on the urlloader to see if they are being fired. Instead of replacing the log text (with =), consider appending (with +=) to make sure that log messages are not overwritten (make sure that taLog is multiline).

rssLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
rssLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
function securityErrorHandler(e:SecurityErrorEvent):void
{
  taLog.htmlText += "<br/>security error";
}
function ioErrorHandler(e:IOErrorEvent):void
{
  taLog.htmlText += "<br/>io error";
}
Amarghosh
It was a security issue. I had a feeling that was what is going on. I did not know how to test it. Thanks for the help :)!
Parris
Try installing the debug flash player in your browser... it will show you all of these errors. Also, rssXML.ignoreWhitespace = true; is wrong, ignoreWhitespace is a static property of the XML class, and it can't be set individually for each XML... the default value is true though ;)
Cay