diff --git a/custom-03d4-tilelist/TileListApp.as b/custom-03d4-tilelist/TileListApp.as new file mode 100644 index 0000000..e7f560c --- /dev/null +++ b/custom-03d4-tilelist/TileListApp.as @@ -0,0 +1,37 @@ +package +{ + import mx.core.Application; + import mx.controls.TextInput; + import mx.controls.Text; + import mx.collections.ArrayCollection; + import mx.events.ListEvent; + import mx.rpc.events.ResultEvent; + import mx.rpc.http.HTTPService; + + public class TileListApp extends Application + { + [Bindable] + public var photoFeed:ArrayCollection = new ArrayCollection(); + public var searchTerms:TextInput; + public var photoService:HTTPService; + public var textMessage:Text; + + public function requestPhotos():void { + var params:Object = new Object(); + params.format = 'rss_200_enc'; + params.tags = searchTerms.text; + photoService.send(params); + } + + public function photoHandler(event:ResultEvent):void { + photoFeed = event.result.rss.channel.item as ArrayCollection; + } + + //show text message when user selects image + public function showMessage(event:Event):void { + textMessage.text = "You selected: " + + event.currentTarget.selectedItem.title + "\nUploaded by: " + + event.currentTarget.selectedItem.credit; + } + } +} diff --git a/custom-03d4-tilelist/TileListExample.mxml b/custom-03d4-tilelist/TileListExample.mxml new file mode 100644 index 0000000..c374398 --- /dev/null +++ b/custom-03d4-tilelist/TileListExample.mxml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +