PDA

View Full Version : Identifying in script when rss feed has no rss.channel.item properties


Ostara
11-18-2008, 12:03 PM
Hi All,
New to flex and learning as I go, and hoping someone can help me with this issue that a good time of scouring the net has not been able to shed light on.

I have a HTTP service that requests and RSS feed, and that works fine, however occasionally this feed will have no items in it, so when you look in debugger you get an event.result but there are no rss.channel.item in there. I essentially want to pass the result into an arraycollection if there are items there otherwise not do this or the application errors.

Any help would be appreciated.

Rgds :p

Ostara
11-18-2008, 12:09 PM
Typical... soon as I register and post figure it out ><

private function initRequestResult(event:ResultEvent):void{


if(skuResultArray = event.result.rss.channel.item as ArrayCollection){
trace(skuResultArray.length);
} else {
trace("NO RESULTS!");
}

Seemed to work as intended.