I think you're making it more complicated then it needs to be.  Try this:

<mx:HTTPService id="httpRSS"
url="{ rssURL }" resultFormat="object"
showBusyCursor="true"
result="onResult(event)"
fault="onFault()"
/>

<** snip **>

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



--- In [email protected], "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:
> 
>     <mx:HTTPService id="httpRSS" url="{ rssURL }"   
>         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
> 
> *********************************************************
> *********************************************************
> *********************************************************
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <mx:Application xmlns:mx="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">
> 
>     <mx:HTTPService id="httpRSS" 
>         url="{ rssURL }" resultFormat="object"
>         showBusyCursor="true"/>
> 
>         <!--         result="onComplete( event )" -->
>     <mx:Script>
>         <![CDATA[
>               import mx.controls.Alert;
>               import mx.rpc.AsyncToken;
>             import mx.formatters.DateFormatter;
>             import flash.net.navigateToURL;
>             import mx.collections.ArrayCollection;
>             import mx.rpc.events.ResultEvent;
>             
>             [Bindable]
>             private var rssURL:String =
>
"http://weblogs.macromedia.com/mxna/xml/rss.cfm?query=byCategory&languages=1&categoryId=5";;
>             
>             [Bindable]
>             private var externalData:ArrayCollection;
>             
>             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 );       
        
>             }
> 
>             
>             public function onFault():void
>             {
>                 mx.controls.Alert.show("http error");
>             }
> 
>             private function processURL( url:String ):void {
>                 var request:URLRequest = new URLRequest(url);
>                 navigateToURL( request );
>             }
>             
>             private function formatDate( date:String ):String {
>                 var df:DateFormatter = new DateFormatter();
>                 df.formatString = "(YYYY.MM.DD)";
>                 return df.format( date );
>             }
> 
>         ]]>
>     </mx:Script>
>     <mx:Panel layout="vertical"
>         title="Adobe MXNA Flex Feed (RSS Reader Example #2)"
>         width="100%" height="100%" 
>         paddingLeft="5" paddingRight="5" paddingBottom="5"
paddingTop="5">
> 
>         <mx:Repeater width="100%"
>             id="newsItems"
>             dataProvider="{ externalData }">
>             <mx:VBox width="100%" horizontalAlign="left"
> creationCompleteEffect="Fade">
>                 <mx:LinkButton id="lbtn"
>                     textAlign="left"
>                     label="{ newsItems.currentItem.title }" 
>                     click="processURL(
> event.currentTarget.getRepeaterItem().link )" />
>                 <mx:TextArea paddingLeft="10" paddingRight="10"
> editable="false"
>                     width="98%" cornerRadius="6" height="50"
>                     backgroundColor="0xFAFAFA"
>                     htmlText="{ newsItems.currentItem.description }"
> ></mx:TextArea>
>                 <mx:Text paddingRight="10" 
>                     width="98%" 
>                     textAlign="right"
>                     text="{ newsItems.currentItem.creator + ' ' +
> newsItems.currentItem.date + ' ' + newsItems.currentItem.subject }" />
>                    
>             </mx:VBox>
>         </mx:Repeater>
>     </mx:Panel>
> </mx:Application>
>


Reply via email to