
vice call. At this point, your code should look like Ex-
ample 3-9.
Example 3-9. The complete script block
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var photoFeed:ArrayCollection;
private function requestPhotos():void{
photoService.cancel();
var params:Object = new Object();
params.format = 'rss_200_enc';
params.tags = searchTerms.text;
photoService.send(params);
}
private function photoHandler(event:ResultEvent)
:void{
}
]]>
</mx:Script>
2. In the photoHandler() function, populate the photoFeed
variable with the data located in the event object,
event.result.rss.channel.item, and type it as ArrayCol
lection. Your code should now look like Example 3-10.
Example 3-10. Adding the photoHandler
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var photoFeed:ArrayCollection;
private function requestPhotos():void{
photoService.cancel();
var params:Object = new Object();
params.format = 'rss_200_enc';
28 | Chapter 3: Flex 101: Step by Step
Komentáře k této Příručce