Permalink
Browse files

in the middle of a bunch of crap

  • Loading branch information...
1 parent bdbf9af commit e9e2efbea29aeb45236e2978591fc5d8c4c0c6ae @seanhess committed May 15, 2009
@@ -0,0 +1,9 @@
+package flickr.manager
+{
+ public class ApplicationManager
+ {
+ public function ApplicationManager()
+ {
+ }
+ }
+}
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<events:EventDispatcher xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:business="flickr.business.*" xmlns:model="flickr.model.*" xmlns:events="flash.events.*">
+
+ <mx:HTTPService id="configService" resultFormat="e4x" url="assets/config/configuration.xml" result="onConfigLoaded(event)"/>
+
+ <mx:Script>
+ <![CDATA[
+ import flickr.model.Config;
+
+ import mx.rpc.events.ResultEvent;
+
+ [Bindable] public var config:Config;
+
+ public function loadConfig():void
+ {
+ configService.send();
+ }
+
+ private function onConfigLoaded(event:ResultEvent):void
+ {
+ var info:XML = event.result as XML;
+ config.setValues(info..url, info..api_key);
+ }
+ ]]>
+ </mx:Script>
+</events:EventDispatcher>
@@ -0,0 +1,31 @@
+package flickr.manager
+{
+ import mx.rpc.events.ResultEvent;
+ import flickr.model.Photos;
+ import flickr.model.Search;
+
+ public class PhotoManager
+ {
+ public var photos:Photos;
+ private var currentSearch:Search;
+
+ public function getInterestingness():void
+ {
+ interestingness.send();
+ }
+
+ public function search(value:Search):void
+ {
+ currentSearch = value;
+ searching.send();
+ }
+
+ private function onResult(event:ResultEvent):void
+ {
+ var list:Array = parser.parseXML(event.result as XML);
+ this.photos.storePhotos(list);
+ }
+
+
+ }
+}
@@ -1,26 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<events:EventDispatcher xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:business="flickr.business.*" xmlns:model="flickr.model.*" xmlns:events="flash.events.*">
-
- <mx:HTTPService id="configService" resultFormat="e4x" url="assets/config/configuration.xml" result="onConfigLoaded(event)"/>
-
- <mx:Script>
- <![CDATA[
- import flickr.model.Config;
-
- import mx.rpc.events.ResultEvent;
-
- [Bindable] public var config:Config;
-
- public function loadConfig():void
- {
- configService.send();
- }
-
- private function onConfigLoaded(event:ResultEvent):void
- {
- var info:XML = event.result as XML;
- config.setValues(info..url, info..api_key);
- }
- ]]>
- </mx:Script>
-</events:EventDispatcher>
+<mx:Object xmlns:mx="http://www.adobe.com/2006/mxml">
+ <mx:HTTPService id="configService" resultFormat="e4x" url="assets/config/configuration.xml"/>
+</mx:Object>
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Object xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:business="flickr.business.*" xmlns:model="flickr.model.*" xmlns:service="flickr.service.*">
+
+ <mx:Script>
+ <![CDATA[
+ import flickr.store.Config;
+
+ [Bindable] public var config:Config;
+ ]]>
+ </mx:Script>
+
+ <!-- Other Services -->
+ <mx:HTTPService id="interestingness" url="{config.url}" resultFormat="e4x" result="onResult(event)">
+ <mx:request>
+ <api_key>{config.key}</api_key>
+ <method>flickr.interestingness.getList</method>
+ </mx:request>
+ </mx:HTTPService>
+
+ <mx:HTTPService id="searching" url="{config.url}" resultFormat="e4x" result="onResult(event)">
+ <mx:request>
+ <api_key>{config.key}</api_key>
+ <method>flickr.photos.search</method>
+ <user_id>{currentSearch.user}</user_id>
+ <page>{currentSearch.page}</page>
+ <tags>{currentSearch.tags}</tags>
+ </mx:request>
+ </mx:HTTPService>
+
+ <service:FlickrParser id="parser"/>
+
+</mx:Object>
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Object xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:business="flickr.business.*" xmlns:model="flickr.model.*" xmlns:service="flickr.service.*">
+
+ <mx:Array id="list">
+ <model:Photo farmId="1" photoId="3263147997" isPublic="true" secret="ba252ca104" serverId="241" title="RIA-Survey"/>
+ <model:Photo farmId="4" photoId="3102433937" isPublic="true" secret="fdb85613e4" serverId="3237" title="bW.Calc-iT"/>
+ <model:Photo farmId="4" photoId="3052457714" isPublic="true" secret="ab49c8e883" serverId="3182" title="Trixie and Flex"/>
+ <model:Photo farmId="4" photoId="2948015888" isPublic="true" secret="3178196411" serverId="3207" title="Eboy"/>
+ <model:Photo farmId="4" photoId="2936186907" isPublic="true" secret="27aa5f4888" serverId="3157" title="MiamiPHP Pool Party"/>
+ <model:Photo farmId="4" photoId="2937041802" isPublic="true" secret="ece54ba500" serverId="3198" title="MiamiPHP Pool Party"/>
+ <model:Photo farmId="4" photoId="2936187195" isPublic="true" secret="9445a9551e" serverId="3249" title="MiamiPHP Pool Party - Paul"/>
+ <model:Photo farmId="4" photoId="2936187647" isPublic="true" secret="92438b093f" serverId="3207" title="MiamiPHP Pool Party"/>
+ <model:Photo farmId="4" photoId="2936187059" isPublic="true" secret="22d484729c" serverId="3009" title="MiamiPHP Pool Party"/>
+ </mx:Array>
+
+ <mx:Script>
+ <![CDATA[
+ import flickr.model.Photos;
+ import flickr.model.Search;
+
+ [Bindable] public var photos:Photos;
+
+ public function getInterestingness():void
+ {
+ photos.storePhotos(list);
+ }
+
+ public function search(value:Search):void
+ {
+ getInterestingness();
+ }
+ ]]>
+ </mx:Script>
+
+</mx:Object>
@@ -1,4 +1,4 @@
-package flickr.model
+package flickr.store
{
import flash.events.EventDispatcher;
@@ -1,4 +1,4 @@
-package flickr.model
+package flickr.store
{
import flash.events.Event;
import flash.events.EventDispatcher;
@@ -9,10 +9,5 @@ package flickr.model
public class Photos extends EventDispatcher
{
public var currentSet:ArrayCollection;
-
- public function storePhotos(photos:Array):void
- {
- currentSet = new ArrayCollection(photos);
- }
}
}

0 comments on commit e9e2efb

Please sign in to comment.