MACROMEDIA FLEX-GETTING STARTED WITH FLEX Manuale Utente Pagina 50

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 148
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 49
var params:Object = new Object();
params.format = 'rss_200_enc';
params.tags = searchTerms.text;
photoService.send(params);
}
private function photoHandler(event:ResultEvent)
:void {
photoFeed = event.result.rss.channel.item as
ArrayCollection;
}
]]>
</mx:Script>
<mx:HTTPService id="photoService"
url="http://api.flickr.com/services/feeds
/photos_public.gne"
result="photoHandler(event)" />
<mx:HBox>
<mx:Label text="Flickr tags or search terms:" />
<mx:TextInput id="searchTerms" />
<mx:Button label="Search"
click="requestPhotos()" />
</mx:HBox>
<mx:TileList width="100%" height="100%"
dataProvider="{photoFeed}"
itemRenderer="FlickrThumbnail">
</mx:TileList>
</mx:Application>
The complete code for the image item rendering component is
shown in Example 3-22.
Example 3-22. The custom image rendering component
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
width="125" height="125"
horizontalAlign="center"
paddingBottom="5" paddingLeft="5" paddingRight="5"
paddingTop="5">
<mx:Image
width="75" height="75"
source="{data.thumbnail.url}" />
<mx:Text width="100" text="{data.credit}" />
</mx:VBox>
34 | Chapter 3:Flex 101: Step by Step
Vedere la pagina 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 147 148

Commenti su questo manuale

Nessun commento