
params.tags = searchTerms.text;
photoService.send(params);
}
private function photoHandler(event:ResultEvent)
:void{
photoFeed = event.result.rss.channel.item as
ArrayCollection;
}
]]>
</mx:Script>
Now we’re ready to create the Tile component in MXML, bind
the photoFeed XML data to the TileList component, and then
create the thumbnails item renderer in the Tile component:
1. We will use a TileList component to display the images.
After the HBox component and before the closing Appli
cation tag, add a TileList component with a width of
100% and a height of 100%. This TileList is shown in
Example 3-11.
Example 3-11. The TileList
<mx:TileList width="100%" height="100%">
</mx:TileList>
2. Using the Outline view, locate the TileList component
and add an attribute of dataProvider with a value of
{photoFeed} to bind the data to the tile component. (Re-
member to move the > to the end of the dataProvider
line.) Example 3-12 shows the completed TileList com-
ponent.
Example 3-12. The completed TileList
<mx:TileList width="100%" height="100%"
dataProvider="{photoFeed}">
</mx:TileList>
3. The item renderer renders the layout for each item in the
TileList. Within the TileList component, add an item
Renderer property, using the code shown in Exam-
ple 3-13.
A Flickr Viewer | 29
Komentáře k této Příručce