MACROMEDIA FLEX-GETTING STARTED WITH FLEX Manuale Utente Pagina 44

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 148
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 43
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
Vedere la pagina 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 147 148

Commenti su questo manuale

Nessun commento