topical media & game development

talk show tell print

professional-flex-code-05-RPCServices.mx

professional-flex-code-05-RPCServices.mx [swf] flex


  <?xml version="1.0" encoding="utf-8"?>
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
          verticalAlign="middle"
          horizontalAlign="center">
  
          <mx:Script>
                  <![CDATA[
                          
                          private var API_KEY:String = "[your flickr api key]";
                          [Bindable] private var URL:String = "http://api.flickr.com/services/rest/?method=flickr.photos.getRecent&api_key=" + API_KEY;
                          
                  ]]>
          </mx:Script>
          
          <mx:HTTPService id="srv" url="{URL}" useProxy="false" showBusyCursor="true" />
          
          <mx:Button label="Get Recent" click="srv.send()" />
          
          <mx:TileList id="myList" dataProvider="{srv.lastResult.rsp.photos.photo}" width="450" height="300">
                  <mx:itemRenderer>
                          <mx:Component>
                                  <mx:VBox width="80" height="80">
                                          <mx:Image source="http://static.flickr.com/{data.server}/{data.id}_{data.secret}_s.jpg" />
                                  </mx:VBox>
                          </mx:Component>
                  </mx:itemRenderer>
          </mx:TileList>
          
  </mx:Application>
  


(C) Æliens 04/09/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.