Re: [flexcoders] Re: rss feed not working

2008-04-02 Thread Vivian Richard
   thanks. Yes you are right, my code is more complicated. But since
   I am using Cairngorm, this is the way that I need to do it. In Cairngorm
   architecture you put all you HTTPServices in one file in mxml tags like:

   
   

   You instantiate and send the http request from another file where you
also
   add and declare the fault and result handler. So When you send the
   HTTP request you will dynamically add the result and fault handler during
   run time. That is what I was trying to do

   I guess my main problem is I am not processing the resultEvent proporly




On Wed, Apr 2, 2008 at 1:32 PM, Kevin <[EMAIL PROTECTED]> wrote:

>   I think you're making it more complicated then it needs to be. Try this:
>
>
>  url="{ rssURL }" resultFormat="object"
> showBusyCursor="true"
> result="onResult(event)"
> fault="onFault()"
> />
>
> <** snip **>
>
> public function init():void
> {
> httpRSS.send();
> }
>
> --- In flexcoders@yahoogroups.com , "hworke"
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi am reading an rss file and calling the HTTPService with
> > action script then handling the HTTPService result to a
> > AsyncToken and finally handling the result is onResult function.
> >
> > But for some reason It is not giving me any return.
> > Here is the HTTPService and the function that calls it:
> >
> >  > resultFormat="object" showBusyCursor="true"/>
> >
> >
> > public function init():void
> > {
> > httpRSS.send();
> > var token:AsyncToken = httpRSS.send();
> > var callResponder:Responder = new Responder(onResult,onFault);
> > }
> >
> > public function onResult(event:ResultEvent):void
> > {
> > var tmp:Object = event.result.RDF.item;
> > var items:Array = new Array();
> > for( var i:String in tmp )
> > {
> > items.push( tmp[i] );
> > }
> > externalData = new ArrayCollection( items );
> > }
> >
> > *
> > *
> > *
> >
> > Here is the whole code
> >
> > *
> > *
> > *
> >
> >
> > 
> >
> > http://www.adobe.com/2006/mxml";
> > xmlns:iframe="com.renaun.iframe.*"
> > creationComplete="init()"
> > width="100%" height="100%"
> > paddingLeft="5" paddingRight="5" paddingBottom="5"
> paddingTop="5"
> > horizontalAlign="left"
> > layout="vertical" viewSourceURL="srcview/index.html">
> >
> >  > url="{ rssURL }" resultFormat="object"
> > showBusyCursor="true"/>
> >
> > 
> > 
> > 
> > 
> >  > title="Adobe MXNA Flex Feed (RSS Reader Example #2)"
> > width="100%" height="100%"
> > paddingLeft="5" paddingRight="5" paddingBottom="5"
> paddingTop="5">
> >
> >  > id="newsItems"
> > dataProvider="{ externalData }">
> >  > creationCompleteEffect="Fade">
> >  > textAlign="left"
> > label="{ newsItems.currentItem.title }"
> > click="processURL(
> > event.currentTarget.getRepeaterItem().link )" />
> >  > editable="false"
> > width="98%" cornerRadius="6" height="50"
> > backgroundColor="0xFAFAFA"
> > htmlText="{ newsItems.currentItem.description }"
> > >
> >  > width="98%"
> > textAlign="right"
> > text="{ newsItems.currentItem.creator + ' ' +
> > newsItems.currentItem.date + ' ' + newsItems.currentItem.subject }" />
> >
> > 
> > 
> > 
> > 
> >
>
>  
>


[flexcoders] Re: rss feed not working

2008-04-02 Thread Kevin
I think you're making it more complicated then it needs to be.  Try this:



<** snip **>

public function init():void
{
httpRSS.send();
}



--- In flexcoders@yahoogroups.com, "hworke" <[EMAIL PROTECTED]> wrote:
>
> 
>   Hi am reading an rss file and calling the HTTPService with
>   action script then handling the HTTPService result to a 
>   AsyncToken and finally handling the result is onResult function.
> 
>   But for some reason It is not giving me any return.
>   Here is the HTTPService and the function that calls it:
> 
>  resultFormat="object" showBusyCursor="true"/>
> 
> 
>  public function init():void
>  {
>   httpRSS.send();
>   var token:AsyncToken = httpRSS.send();
>   var callResponder:Responder = new Responder(onResult,onFault); 
>  }
> 
>  public function onResult(event:ResultEvent):void
>  {
> var tmp:Object = event.result.RDF.item;
> var items:Array = new Array();
> for( var i:String in tmp )
> {
>   items.push( tmp[i] );
> }
> externalData = new ArrayCollection( items );  
>  }   
> 
> *
> *
> *
> 
> Here is the whole code
> 
> *
> *
> *
> 
> 
> 
> 
> http://www.adobe.com/2006/mxml";
> xmlns:iframe="com.renaun.iframe.*"
> creationComplete="init()"
> width="100%" height="100%"
> paddingLeft="5" paddingRight="5" paddingBottom="5"
paddingTop="5"
> horizontalAlign="left"
> layout="vertical" viewSourceURL="srcview/index.html">
> 
>  url="{ rssURL }" resultFormat="object"
> showBusyCursor="true"/>
> 
> 
> 
> 
> 
>  title="Adobe MXNA Flex Feed (RSS Reader Example #2)"
> width="100%" height="100%" 
> paddingLeft="5" paddingRight="5" paddingBottom="5"
paddingTop="5">
> 
>  id="newsItems"
> dataProvider="{ externalData }">
>  creationCompleteEffect="Fade">
>  textAlign="left"
> label="{ newsItems.currentItem.title }" 
> click="processURL(
> event.currentTarget.getRepeaterItem().link )" />
>  editable="false"
> width="98%" cornerRadius="6" height="50"
> backgroundColor="0xFAFAFA"
> htmlText="{ newsItems.currentItem.description }"
> >
>  width="98%" 
> textAlign="right"
> text="{ newsItems.currentItem.creator + ' ' +
> newsItems.currentItem.date + ' ' + newsItems.currentItem.subject }" />
>
> 
> 
> 
> 
>