From 111bf2c489c507dc40b1237315258dfdc9ee13f9 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 21 Feb 2010 16:19:54 -0500 Subject: [PATCH] beginning custom version of 03d4 --- custom-03d4-tilelist/TileListApp.as | 37 ++++++++++++++++++ custom-03d4-tilelist/TileListExample.mxml | 47 +++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 custom-03d4-tilelist/TileListApp.as create mode 100644 custom-03d4-tilelist/TileListExample.mxml 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +