topical media & game development

talk show tell print

lib-flex-service-flickr-viewer.mx

lib-flex-service-flickr-viewer.mx (swf ) [ flash ] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
  
          <mx:Blur
                  id="blur"
                  target="{resultsList}"
                  duration="200"
                  blurXFrom="0" blurXTo="75"/>
  
          <mx:HTTPService
                  id="flickr"
                  showBusyCursor="true"
                  url="lib-flex-service-flickr-proxy.php?url=http://www.flickr.com/services/rest/?method=flickr.photos.search%26api_key=533318e5cc8be817c3a619b1db9ef335%26per_page=16%26tags={inputBox.text}"/>
  
          <mx:states>
  
                  <mx:State name="results">
                          <mx:SetProperty target="{thePanel}" name="width" value="100%"/>
                          <mx:SetProperty target="{thePanel}" name="height" value="100%"/>
                          <mx:AddChild relativeTo="{thePanel}" position="lastChild">
                                  <mx:TileList 
                                          x="0" y="95" width="100%" height="100%"
                                          id="resultsList"
                                          dataProvider="{flickr.lastResult.rsp.photos.photo}"
                                          itemRenderer="lib_flex_service_flickr_thumbnail"
                                          change="currentState='focus'"/>
                          </mx:AddChild>
                  </mx:State>
                  <mx:State name="focus" basedOn="results" enterState="blur.play()" exitState="blur.play(null, true)">
                          <mx:AddChild relativeTo="{thePanel}">
                                  <mx:Image
                                          id="focusImage"
                                          horizontalCenter="0" verticalCenter="0"
                                          source="http://static.flickr.com/{resultsList.selectedItem.server}/{resultsList.selectedItem.id}_{resultsList.selectedItem.secret}.jpg"
                                          click="currentState='results'"/>
                          </mx:AddChild>
                  </mx:State>
  
          </mx:states>        
  
          <mx:Panel width="302" height="136" layout="absolute" verticalCenter="0" horizontalCenter="0.5" id="thePanel" resizeEffect="Resize">
                  <mx:TextInput x="24.5" y="36" id="inputBox"/>
                  <mx:Button x="192.5" y="36" label="Search" id="searchButton" click="currentState='results';flickr.send()"/>
          </mx:Panel>
  
  </mx:Application>
  
  


(C) Æliens 18/6/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.