SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
<?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
<rsp stat=quot;okquot;>
<photos page=quot;1quot; pages=quot;4quot; perpage=quot;100quot; total=quot;360quot;>
	   <photo id=quot;2878963976quot; owner=quot;64925044@N00quot; secret=quot;78ff42e98cquot;
server=quot;3199quot; farm=quot;4quot; title=quot;080927_              quot; ispublic=quot;1quot; isfriend=quot;0quot;
isfamily=quot;0quot; />
	   <photo id=quot;2878130929quot; owner=quot;64925044@N00quot; secret=quot;53680e4271quot;
server=quot;3027quot; farm=quot;4quot; title=quot;080927_              quot; ispublic=quot;1quot; isfriend=quot;0quot;
isfamily=quot;0quot; />
	   <photo id=quot;2878130717quot; owner=quot;64925044@N00quot; secret=quot;b3f9c8d178quot;
server=quot;3232quot; farm=quot;4quot; title=quot;080927_              quot; ispublic=quot;1quot; isfriend=quot;0quot;
isfamily=quot;0quot; />
	   ...
</photos>
</rsp>
as3flickrlib
package {
	   import com.adobe.webapis.flickr.*;
	   import com.adobe.webapis.flickr.events.*;
	   import com.adobe.webapis.flickr.methodgroups.*;
	   import flash.display.*;
	   import flash.events.*;
	   import flash.net.*;
	   import flash.text.*;
	   [SWF(backgroundColor=quot;#888888quot;)]
	   public class FlickrTest extends Sprite
	   {
	   	      //--------------------------------------
	   	      // CLASS CONSTANTS
	   	      //--------------------------------------
	   	      private static const UID:String = quot;Flickr API_KEY   quot;;
	   	     //--------------------------------------
	   	     // CONSTRUCTOR
	   	     //--------------------------------------
	   	     public function FlickrTest()
	   	     {
	   	     	    //
	   	     	    stage.align = StageAlign.TOP_LEFT;
	   	     	    stage.scaleMode = StageScaleMode.NO_SCALE;
//Flickr API
	   	       	   var fls:FlickrService = new FlickrService(UID);
	   	       	   //
	   	     	    fls.addEventListener(FlickrResultEvent.PHOTOS_SEARCH,
onFlickrSearchComplete);
	   	     	    //        quot;Tamabiquot;
	   	       	    fls.photos.search(quot;quot;, quot;Tamabiquot;, quot;anyquot;, quot;quot;);
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE VARIABLES
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // GETTER/SETTERS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // PUBLIC METHODS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // EVENT HANDLERS
	   	       //--------------------------------------	    	
	   	       //
	   	       private function onFlickrSearchComplete(event:FlickrResultEvent):void
	   	       {
//                   	
	   	       	   var photos:Array   = PagedPhotoList( event.data['photos'] ).photos;
	   	       	   //
	   	       	   for ( var i:int = 0; i < photos.length; i++ ) {
	   	       	   	    //
	   	       	   	    var curPhoto:Photo       = photos[i];
	   	       	   	    //     URL
	   	       	   	    var photoUrl:String = quot;http://farmquot; + curPhoto.farmId
	   	       	   	    + quot;.static.flickr.com/quot; + curPhoto.server
	   	       	   	    + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret + quot;.jpgquot;;
	   	       	   	    //
	   	       	    	    trace(quot;photo[quot; + i + quot;] : quot; + photoUrl);
	   	       	    }
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE & PROTECTED INSTANCE METHODS
	   	       //--------------------------------------
	   }
}
package {
	   import com.adobe.webapis.flickr.*;
	   import com.adobe.webapis.flickr.events.*;
	   import com.adobe.webapis.flickr.methodgroups.*;
	   import flash.display.*;
	   import flash.events.*;
	   import flash.net.*;
	   import flash.text.*;
	   [SWF(backgroundColor=quot;#888888quot;)]
	   public class FlickrTest extends Sprite
	   {
	   	      //--------------------------------------
	   	      // CLASS CONSTANTS
	   	      //--------------------------------------
	   	      private static const UID:String = quot;API_KEYquot;;
	   	      //--------------------------------------
	   	      // CONSTRUCTOR
	   	      //--------------------------------------
	   	      public function FlickrTest()
	   	      {
	   	      	    //
	   	     	    stage.align = StageAlign.TOP_LEFT;
	   	     	    stage.scaleMode = StageScaleMode.NO_SCALE;
//Flickr API
	   	       	   var fls:FlickrService = new FlickrService(UID);
	   	       	   //
	   	     	    fls.addEventListener(FlickrResultEvent.PHOTOS_SEARCH,
onFlickrSearchComplete);
	   	     	    //        quot;Tamabiquot;
	   	       	    fls.photos.search(quot;quot;, quot;Tamabiquot;, quot;anyquot;, quot;quot;);
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE VARIABLES
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // GETTER/SETTERS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // PUBLIC METHODS
	   	       //--------------------------------------
	   	       //
	   	       public function swapToTop(img:ImageLoader):void
	   	       {
	   	       	    addChild(img);
	   	       }
//--------------------------------------
	   	       // EVENT HANDLERS
	   	       //--------------------------------------	    	
	   	       //
	   	       private function onFlickrSearchComplete(event:FlickrResultEvent):void
	   	       {
	   	       	    //                	
	   	       	    var photos:Array   = PagedPhotoList( event.data['photos'] ).photos;
	   	       	    //
	   	       	    for ( var i:int = 0; i < photos.length; i++ ) {
	   	       	    	    //
	   	       	    	    var curPhoto:Photo   = photos[i];
	   	       	    	    //     URL
	   	       	    	    var photoUrl:String = quot;http://farmquot; + curPhoto.farmId
	   	       	    	    + quot;.static.flickr.com/quot; + curPhoto.server
	   	       	    	    + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret + quot;.jpgquot;;
	   	       	    	    //
	   	       	    	    trace(quot;photo[quot; + i + quot;] : quot; + photoUrl);
	   	       	    	    //ImagLoader
	   	       	    	    var imgLoader:ImageLoader = new ImageLoader(photoUrl, this);
	   	       	    	    addChild(imgLoader);
	   	       	    }
	   	       }
//--------------------------------------
	   	       // PRIVATE & PROTECTED INSTANCE METHODS
	   	       //--------------------------------------
	   }
}
// ImageLoader.as
package {
	   import flash.display.*;
	   import flash.net.*;
	   import flash.events.*;
	   import flash.text.*;
	   import flash.filters.DropShadowFilter;
	   import gs.TweenMax;
	   import gs.easing.*;
	   public class ImageLoader extends Sprite {
	   	     //--------------------------------------
	   	     // CLASS CONSTANTS
	   	     //--------------------------------------
	   	     //--------------------------------------
	   	     // CONSTRUCTOR
	   	     //--------------------------------------
	   	     public function ImageLoader(url:String, main:Object)
	   	     {
	   	     	    //
	   	    	    _main = main;
	   	    	    scaleX = 0;
	   	    	    scaleY = 0;
	   	    	    buttonMode = true;
//
	   	       	   filters = [new DropShadowFilter(0,0,0,0.5,16,16)];
	   	       	   //loader
	   	       	   _imgLoader = new Loader();
	   	       	   //
	   	       	   _imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaded);
	   	       	   //
	   	       	   this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
	   	       	   this.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
	   	       	   //
	   	       	    var urlReq:URLRequest=new URLRequest(url);
	   	       	    _imgLoader.load(urlReq);
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE VARIABLES
	   	       //--------------------------------------
	   	       private var _main:Object;
	   	       private var _url:String;
	   	       private var _imgLoader:Loader;
	   	       private var _perFld:TextField;
	   	       private var _width:Number;
	   	       private var _height:Number;
//--------------------------------------
	   	       // GETTER/SETTERS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // PUBLIC METHODS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // EVENT HANDLERS
	   	       //--------------------------------------
	   	       //
	   	       private function onLoaded(event:Event):void
	   	       {
	   	       	    //
	   	       	    var info:LoaderInfo = LoaderInfo(_imgLoader.contentLoaderInfo);
	   	       	    _imgLoader.width = info.width / 4;
	   	       	    _imgLoader.height = info.height / 4;
	   	       	    _imgLoader.x = -_imgLoader.width / 2;
	   	       	    _imgLoader.y = -_imgLoader.height / 2;
	   	       	    //
	   	       	    x = stage.stageWidth / 2;
	   	       	    y = stage.stageHeight / 2;
	   	       	    //
	   	       	    drawBaseRect();
//
	   	       	   addChild(_imgLoader);
	   	       	   //
	   	       	   _main.swapToTop(this);
	   	       	   //
	   	     	    TweenMax.to(this, 1, {scaleX:1, scaleY:1, ease:Elastic.easeOut});
	   	     	    TweenMax.to(this, 1, {rotation:Math.random() * 360 - 180,
ease:Quint.easeOut});
	   	     	    TweenMax.to(this, 1, {x:Math.random() * stage.stageWidth,
y:Math.random() * stage.stageHeight, ease:Quint.easeOut});
	   	     }
	   	     //
	   	       private function onMouseDown(event:MouseEvent):void
	   	       {
	   	       	    //
	   	       	   this.startDrag(true);
	   	       	   //
	   	       	   _main.swapToTop(this);
	   	       	   //
	   	       	   TweenMax.to(this, 1, {scaleX:4.0, scaleY:4.0, ease:Elastic.easeOut});
	   	       	   TweenMax.to(this, 0.2, {rotation:0, ease:Quint.easeOut});
	   	       }
//
	   	     private function onMouseUp(event:MouseEvent):void
	   	     {
	   	     	    this.stopDrag();
	   	     	    TweenMax.to(this, 1, {rotation:Math.random() * 360 - 180, scaleX:1.0,
scaleY:1.0, ease:Quint.easeOut});
	   	     }
	   	     //--------------------------------------
	   	     // PRIVATE & PROTECTED INSTANCE METHODS
	   	     //--------------------------------------
	   	     //
	   	    private function drawBaseRect():void
	   	    {
	   	    	    var rect:Sprite = new Sprite();
	   	    	    rect.graphics.beginFill(0xFFFFFF);
	   	    	    rect.graphics.drawRect(-3, -3, _imgLoader.width + 6, _imgLoader.height
+ 6);
	   	    	    rect.x = -_imgLoader.width / 2;
	   	    	    rect.y = -_imgLoader.height / 2;
	   	    	    addChild(rect);
	   	    }
	   }
}
package {
	   import com.adobe.webapis.flickr.*;
	   import com.adobe.webapis.flickr.events.*;
	   import com.adobe.webapis.flickr.methodgroups.*;
	   import flash.display.*;
	   import flash.events.*;
	   import flash.net.*;
	   import flash.text.*;
	   [SWF(backgroundColor=quot;#888888quot;)]
	   public class FlickrSearch extends Sprite
	   {
	   	      //--------------------------------------
	   	      // CLASS CONSTANTS
	   	      //--------------------------------------
	   	      private static const UID:String = quot;API_KEYquot;;
	   	      //--------------------------------------
	   	      // CONSTRUCTOR
	   	      //--------------------------------------
	   	      public function FlickrSearch()
	   	      {
	   	      	    //
	   	     	    stage.align = StageAlign.TOP_LEFT;
	   	     	    stage.scaleMode = StageScaleMode.NO_SCALE;
//
	   	       	    _photoLayer = new Sprite();
	   	       	    addChild(_photoLayer);
	   	       	    //GUI
	   	       	    _guiLayer = new Sprite();
	   	       	    addChild(_guiLayer);
	   	       	    //
	   	       	    createUI();
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE VARIABLES
	   	       //--------------------------------------
	   	       private var _photoLayer:Sprite; //
	   	       private var _guiLayer:Sprite; //UI
	   	       private var _headerBackground:Sprite; //UI
	   	       private var _tf:TextField; //
	   	       private var _searchButton:SimpleButton; //
	   	       private var _resetButton:SimpleButton; //
	   	       private var _fls:FlickrService; //Flickr
	   	       private var _photos:Photos; //
//--------------------------------------
	   	       // GETTER/SETTERS
	   	       //--------------------------------------
	   	       //--------------------------------------
	   	       // PUBLIC METHODS
	   	       //--------------------------------------
	   	       //
	   	       public function swapToTop(img:ImageLoader):void
	   	       {
	   	       	    _photoLayer.addChild(img);
	   	       }
	   	       //--------------------------------------
	   	       // EVENT HANDLERS
	   	       //--------------------------------------
	   	       //search
	   	     private function onSearchButtonClick(event:Event):void
	   	     {
	   	     	    _fls = new FlickrService(UID);
	   	     	    _fls.addEventListener( FlickrResultEvent.PHOTOS_SEARCH,
onFlickrSearchComplete);
	   	     	    _fls.photos.search(quot;quot;, _tf.text, quot;anyquot;, quot;quot;);
	   	     }
//
	   	       private function onResetButtonClick(event:Event):void
	   	       {
	   	       	    removeChild(_photoLayer);
	   	       	    _photoLayer = new Sprite();
	   	       	    addChild(_photoLayer);
	   	       	    addChild(_guiLayer);
	   	       }
	   	       //
	   	       private function onFlickrSearchComplete(event:FlickrResultEvent):void
	   	       {
	   	       	    //                	
	   	       	   var photos:Array   = PagedPhotoList( event.data['photos'] ).photos;
	   	       	   //
	   	       	   for ( var i:int = 0; i < photos.length; i++ ) {
	   	       	   	    //
	   	       	   	    var curPhoto:Photo   = photos[i];
	   	       	   	    //     URL
	   	     	    	    var photoUrl:String = quot;http://farmquot; + curPhoto.farmId +
quot;.static.flickr.com/quot; + curPhoto.server + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret +
quot;.jpgquot;;
	   	     	    	    //ImagLoader
	   	       	   	    var imgLoader:ImageLoader = new ImageLoader(photoUrl, this);
_photoLayer.addChild(imgLoader);
	   	       	    }
	   	       }
	   	       //--------------------------------------
	   	       // PRIVATE & PROTECTED INSTANCE METHODS
	   	       //--------------------------------------
	   	       //UI
	   	       private function createUI():void
	   	       {
	   	       	    //
	   	       	    _headerBackground = new Sprite();
	   	       	    _headerBackground.graphics.beginFill(0x000000);
	   	       	    _headerBackground.graphics.drawRect(0, 0, 430, 42);
	   	       	    _headerBackground.alpha = 0.8;
	   	       	    _guiLayer.addChild(_headerBackground);
	   	       	    //
	   	       	    _tf = createTextField(10, 10, 200, 20);
	   	       	    _tf.wordWrap = true;
	   	       	    _tf.type = TextFieldType.INPUT;
	   	       	    _tf.text = quot;quot;;
	   	       	    //
	   	       	    _searchButton = new SimpleButton();
	   	       	    _searchButton.x = 214;
	   	       	    _searchButton.y = 10;
_searchButton.upState = makeRoundRect(0x666666, quot;searchquot;);
	   	       	    _searchButton.overState = makeRoundRect(0xcc0000, quot;searchquot;);
	   	       	    _searchButton.downState = makeRoundRect(0x3399cc, quot;searchquot;);
	   	       	    _searchButton.hitTestState = _searchButton.upState;
	   	       	    _searchButton.addEventListener(MouseEvent.CLICK, onSearchButtonClick);
	   	       	    _guiLayer.addChild(_searchButton);
	   	       	    //
	   	       	    _resetButton = new SimpleButton();
	   	       	    _resetButton.x = 316;
	   	       	    _resetButton.y = 10;
	   	       	    _resetButton.upState = makeRoundRect(0x666666, quot;reset quot;);
	   	       	    _resetButton.overState = makeRoundRect(0xcc0000, quot;reset quot;);
	   	       	    _resetButton.downState = makeRoundRect(0x3399cc, quot;reset quot;);
	   	       	    _resetButton.hitTestState = _resetButton.upState;
	   	       	    _resetButton.addEventListener(MouseEvent.CLICK, onResetButtonClick);
	   	       	    _guiLayer.addChild(_resetButton);
	   	       }
	   	       //
	   	     private function createTextField(x:Number, y:Number, width:Number,
height:Number):TextField {
	   	     	    //
	   	       	    var result:TextField = new TextField();
	   	       	    result.x = x;
	   	       	    result.y = y;
result.width = width;
                 result.height = height;
                 result.border = true;
                 result.background = true;
                 //
                 var textFormat:TextFormat = new TextFormat();
                 textFormat.font = quot;Lucida Grandequot;;
                 textFormat.color = 0x444444;
                 textFormat.size = 12;
                 result.defaultTextFormat = textFormat;
                 _guiLayer.addChild(result);
                 return result;
        }
	   	
	   	       //
	   	       private function makeRoundRect(color:uint, st:String):Sprite
	   	       {
	   	       	    //
	   	       	      var s:Sprite = new Sprite();
	   	       	      s.graphics.beginFill(color);
	   	       	      s.graphics.drawRoundRect(0, 0, 100, 21, 21);
	   	       	      s.graphics.endFill();
	   	       	      //
	   	       	      var t:TextField = new TextField();
t.x = 0;
	   	       	   t.y = 0;
	   	       	   t.width = 100;
	   	       	   t.autoSize = TextFieldAutoSize.CENTER;
	   	       	   t.text = st;
	   	       	   //
	   	       	   var textFormat:TextFormat = new TextFormat();
	   	       	   textFormat.font = quot;Lucida Grandequot;;
	   	       	   textFormat.color = 0xFFFFFF;
	   	       	   textFormat.size = 12;
	   	       	   t.setTextFormat(textFormat);
	   	       	   s.addChild(t);
	   	       	   return s;
	   	       }
	   }
}
Ssaw08 1021

Contenu connexe

Similaire à Ssaw08 1021

Treatment, Architecture and Threads
Treatment, Architecture and ThreadsTreatment, Architecture and Threads
Treatment, Architecture and ThreadsMathias Seguy
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesAlbert Jessurum
 
新建 文本文档
新建 文本文档新建 文本文档
新建 文本文档zxdSbjsz
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiBalaji Narayanan
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformRobert Nyman
 
Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Acquia
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rob
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdffeelinggifts
 
Codeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriCodeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriAbdul Malik Ikhsan
 
Loadrunner
LoadrunnerLoadrunner
Loadrunnerdanwrong
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorialjbarciauskas
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it meansRobert Nyman
 
前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpoMichael Zhang
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshowsblackman
 
Proactive Web Performance Optimization.(Marcel Duran)
Proactive Web Performance Optimization.(Marcel Duran)Proactive Web Performance Optimization.(Marcel Duran)
Proactive Web Performance Optimization.(Marcel Duran)Ontico
 

Similaire à Ssaw08 1021 (20)

Treatment, Architecture and Threads
Treatment, Architecture and ThreadsTreatment, Architecture and Threads
Treatment, Architecture and Threads
 
Sbaw091110
Sbaw091110Sbaw091110
Sbaw091110
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
 
YUI on the go
YUI on the goYUI on the go
YUI on the go
 
新建 文本文档
新建 文本文档新建 文本文档
新建 文本文档
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT Chennai
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the Platform
 
Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
 
I wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdfI wanted to change the cloudsrectangles into an actuall image it do.pdf
I wanted to change the cloudsrectangles into an actuall image it do.pdf
 
YUI 3
YUI 3YUI 3
YUI 3
 
openfoam
openfoamopenfoam
openfoam
 
Codeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriCodeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate Uri
 
Loadrunner
LoadrunnerLoadrunner
Loadrunner
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
Test upload
Test uploadTest upload
Test upload
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo前瞻性Web性能优化pwpo
前瞻性Web性能优化pwpo
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshow
 
Proactive Web Performance Optimization.(Marcel Duran)
Proactive Web Performance Optimization.(Marcel Duran)Proactive Web Performance Optimization.(Marcel Duran)
Proactive Web Performance Optimization.(Marcel Duran)
 

Plus de Atsushi Tadokoro

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようAtsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Atsushi Tadokoro
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションAtsushi Tadokoro
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Atsushi Tadokoro
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Atsushi Tadokoro
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くAtsushi Tadokoro
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリAtsushi Tadokoro
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使うAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Atsushi Tadokoro
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得Atsushi Tadokoro
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Atsushi Tadokoro
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するAtsushi Tadokoro
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えAtsushi Tadokoro
 

Plus de Atsushi Tadokoro (20)

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
 

Ssaw08 1021

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <rsp stat=quot;okquot;> <photos page=quot;1quot; pages=quot;4quot; perpage=quot;100quot; total=quot;360quot;> <photo id=quot;2878963976quot; owner=quot;64925044@N00quot; secret=quot;78ff42e98cquot; server=quot;3199quot; farm=quot;4quot; title=quot;080927_ quot; ispublic=quot;1quot; isfriend=quot;0quot; isfamily=quot;0quot; /> <photo id=quot;2878130929quot; owner=quot;64925044@N00quot; secret=quot;53680e4271quot; server=quot;3027quot; farm=quot;4quot; title=quot;080927_ quot; ispublic=quot;1quot; isfriend=quot;0quot; isfamily=quot;0quot; /> <photo id=quot;2878130717quot; owner=quot;64925044@N00quot; secret=quot;b3f9c8d178quot; server=quot;3232quot; farm=quot;4quot; title=quot;080927_ quot; ispublic=quot;1quot; isfriend=quot;0quot; isfamily=quot;0quot; /> ... </photos> </rsp>
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 13.
  • 14.
  • 15. package { import com.adobe.webapis.flickr.*; import com.adobe.webapis.flickr.events.*; import com.adobe.webapis.flickr.methodgroups.*; import flash.display.*; import flash.events.*; import flash.net.*; import flash.text.*; [SWF(backgroundColor=quot;#888888quot;)] public class FlickrTest extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- private static const UID:String = quot;Flickr API_KEY quot;; //-------------------------------------- // CONSTRUCTOR //-------------------------------------- public function FlickrTest() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE;
  • 16. //Flickr API var fls:FlickrService = new FlickrService(UID); // fls.addEventListener(FlickrResultEvent.PHOTOS_SEARCH, onFlickrSearchComplete); // quot;Tamabiquot; fls.photos.search(quot;quot;, quot;Tamabiquot;, quot;anyquot;, quot;quot;); } //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // EVENT HANDLERS //-------------------------------------- // private function onFlickrSearchComplete(event:FlickrResultEvent):void {
  • 17. // var photos:Array = PagedPhotoList( event.data['photos'] ).photos; // for ( var i:int = 0; i < photos.length; i++ ) { // var curPhoto:Photo = photos[i]; // URL var photoUrl:String = quot;http://farmquot; + curPhoto.farmId + quot;.static.flickr.com/quot; + curPhoto.server + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret + quot;.jpgquot;; // trace(quot;photo[quot; + i + quot;] : quot; + photoUrl); } } //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- } }
  • 18.
  • 19.
  • 20. package { import com.adobe.webapis.flickr.*; import com.adobe.webapis.flickr.events.*; import com.adobe.webapis.flickr.methodgroups.*; import flash.display.*; import flash.events.*; import flash.net.*; import flash.text.*; [SWF(backgroundColor=quot;#888888quot;)] public class FlickrTest extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- private static const UID:String = quot;API_KEYquot;; //-------------------------------------- // CONSTRUCTOR //-------------------------------------- public function FlickrTest() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE;
  • 21. //Flickr API var fls:FlickrService = new FlickrService(UID); // fls.addEventListener(FlickrResultEvent.PHOTOS_SEARCH, onFlickrSearchComplete); // quot;Tamabiquot; fls.photos.search(quot;quot;, quot;Tamabiquot;, quot;anyquot;, quot;quot;); } //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- // public function swapToTop(img:ImageLoader):void { addChild(img); }
  • 22. //-------------------------------------- // EVENT HANDLERS //-------------------------------------- // private function onFlickrSearchComplete(event:FlickrResultEvent):void { // var photos:Array = PagedPhotoList( event.data['photos'] ).photos; // for ( var i:int = 0; i < photos.length; i++ ) { // var curPhoto:Photo = photos[i]; // URL var photoUrl:String = quot;http://farmquot; + curPhoto.farmId + quot;.static.flickr.com/quot; + curPhoto.server + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret + quot;.jpgquot;; // trace(quot;photo[quot; + i + quot;] : quot; + photoUrl); //ImagLoader var imgLoader:ImageLoader = new ImageLoader(photoUrl, this); addChild(imgLoader); } }
  • 23. //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- } }
  • 24. // ImageLoader.as package { import flash.display.*; import flash.net.*; import flash.events.*; import flash.text.*; import flash.filters.DropShadowFilter; import gs.TweenMax; import gs.easing.*; public class ImageLoader extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- //-------------------------------------- // CONSTRUCTOR //-------------------------------------- public function ImageLoader(url:String, main:Object) { // _main = main; scaleX = 0; scaleY = 0; buttonMode = true;
  • 25. // filters = [new DropShadowFilter(0,0,0,0.5,16,16)]; //loader _imgLoader = new Loader(); // _imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaded); // this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); this.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); // var urlReq:URLRequest=new URLRequest(url); _imgLoader.load(urlReq); } //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- private var _main:Object; private var _url:String; private var _imgLoader:Loader; private var _perFld:TextField; private var _width:Number; private var _height:Number;
  • 26. //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // EVENT HANDLERS //-------------------------------------- // private function onLoaded(event:Event):void { // var info:LoaderInfo = LoaderInfo(_imgLoader.contentLoaderInfo); _imgLoader.width = info.width / 4; _imgLoader.height = info.height / 4; _imgLoader.x = -_imgLoader.width / 2; _imgLoader.y = -_imgLoader.height / 2; // x = stage.stageWidth / 2; y = stage.stageHeight / 2; // drawBaseRect();
  • 27. // addChild(_imgLoader); // _main.swapToTop(this); // TweenMax.to(this, 1, {scaleX:1, scaleY:1, ease:Elastic.easeOut}); TweenMax.to(this, 1, {rotation:Math.random() * 360 - 180, ease:Quint.easeOut}); TweenMax.to(this, 1, {x:Math.random() * stage.stageWidth, y:Math.random() * stage.stageHeight, ease:Quint.easeOut}); } // private function onMouseDown(event:MouseEvent):void { // this.startDrag(true); // _main.swapToTop(this); // TweenMax.to(this, 1, {scaleX:4.0, scaleY:4.0, ease:Elastic.easeOut}); TweenMax.to(this, 0.2, {rotation:0, ease:Quint.easeOut}); }
  • 28. // private function onMouseUp(event:MouseEvent):void { this.stopDrag(); TweenMax.to(this, 1, {rotation:Math.random() * 360 - 180, scaleX:1.0, scaleY:1.0, ease:Quint.easeOut}); } //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- // private function drawBaseRect():void { var rect:Sprite = new Sprite(); rect.graphics.beginFill(0xFFFFFF); rect.graphics.drawRect(-3, -3, _imgLoader.width + 6, _imgLoader.height + 6); rect.x = -_imgLoader.width / 2; rect.y = -_imgLoader.height / 2; addChild(rect); } } }
  • 29.
  • 30.
  • 31. package { import com.adobe.webapis.flickr.*; import com.adobe.webapis.flickr.events.*; import com.adobe.webapis.flickr.methodgroups.*; import flash.display.*; import flash.events.*; import flash.net.*; import flash.text.*; [SWF(backgroundColor=quot;#888888quot;)] public class FlickrSearch extends Sprite { //-------------------------------------- // CLASS CONSTANTS //-------------------------------------- private static const UID:String = quot;API_KEYquot;; //-------------------------------------- // CONSTRUCTOR //-------------------------------------- public function FlickrSearch() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE;
  • 32. // _photoLayer = new Sprite(); addChild(_photoLayer); //GUI _guiLayer = new Sprite(); addChild(_guiLayer); // createUI(); } //-------------------------------------- // PRIVATE VARIABLES //-------------------------------------- private var _photoLayer:Sprite; // private var _guiLayer:Sprite; //UI private var _headerBackground:Sprite; //UI private var _tf:TextField; // private var _searchButton:SimpleButton; // private var _resetButton:SimpleButton; // private var _fls:FlickrService; //Flickr private var _photos:Photos; //
  • 33. //-------------------------------------- // GETTER/SETTERS //-------------------------------------- //-------------------------------------- // PUBLIC METHODS //-------------------------------------- // public function swapToTop(img:ImageLoader):void { _photoLayer.addChild(img); } //-------------------------------------- // EVENT HANDLERS //-------------------------------------- //search private function onSearchButtonClick(event:Event):void { _fls = new FlickrService(UID); _fls.addEventListener( FlickrResultEvent.PHOTOS_SEARCH, onFlickrSearchComplete); _fls.photos.search(quot;quot;, _tf.text, quot;anyquot;, quot;quot;); }
  • 34. // private function onResetButtonClick(event:Event):void { removeChild(_photoLayer); _photoLayer = new Sprite(); addChild(_photoLayer); addChild(_guiLayer); } // private function onFlickrSearchComplete(event:FlickrResultEvent):void { // var photos:Array = PagedPhotoList( event.data['photos'] ).photos; // for ( var i:int = 0; i < photos.length; i++ ) { // var curPhoto:Photo = photos[i]; // URL var photoUrl:String = quot;http://farmquot; + curPhoto.farmId + quot;.static.flickr.com/quot; + curPhoto.server + quot;/quot; + curPhoto.id + quot;_quot; + curPhoto.secret + quot;.jpgquot;; //ImagLoader var imgLoader:ImageLoader = new ImageLoader(photoUrl, this);
  • 35. _photoLayer.addChild(imgLoader); } } //-------------------------------------- // PRIVATE & PROTECTED INSTANCE METHODS //-------------------------------------- //UI private function createUI():void { // _headerBackground = new Sprite(); _headerBackground.graphics.beginFill(0x000000); _headerBackground.graphics.drawRect(0, 0, 430, 42); _headerBackground.alpha = 0.8; _guiLayer.addChild(_headerBackground); // _tf = createTextField(10, 10, 200, 20); _tf.wordWrap = true; _tf.type = TextFieldType.INPUT; _tf.text = quot;quot;; // _searchButton = new SimpleButton(); _searchButton.x = 214; _searchButton.y = 10;
  • 36. _searchButton.upState = makeRoundRect(0x666666, quot;searchquot;); _searchButton.overState = makeRoundRect(0xcc0000, quot;searchquot;); _searchButton.downState = makeRoundRect(0x3399cc, quot;searchquot;); _searchButton.hitTestState = _searchButton.upState; _searchButton.addEventListener(MouseEvent.CLICK, onSearchButtonClick); _guiLayer.addChild(_searchButton); // _resetButton = new SimpleButton(); _resetButton.x = 316; _resetButton.y = 10; _resetButton.upState = makeRoundRect(0x666666, quot;reset quot;); _resetButton.overState = makeRoundRect(0xcc0000, quot;reset quot;); _resetButton.downState = makeRoundRect(0x3399cc, quot;reset quot;); _resetButton.hitTestState = _resetButton.upState; _resetButton.addEventListener(MouseEvent.CLICK, onResetButtonClick); _guiLayer.addChild(_resetButton); } // private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { // var result:TextField = new TextField(); result.x = x; result.y = y;
  • 37. result.width = width; result.height = height; result.border = true; result.background = true; // var textFormat:TextFormat = new TextFormat(); textFormat.font = quot;Lucida Grandequot;; textFormat.color = 0x444444; textFormat.size = 12; result.defaultTextFormat = textFormat; _guiLayer.addChild(result); return result; } // private function makeRoundRect(color:uint, st:String):Sprite { // var s:Sprite = new Sprite(); s.graphics.beginFill(color); s.graphics.drawRoundRect(0, 0, 100, 21, 21); s.graphics.endFill(); // var t:TextField = new TextField();
  • 38. t.x = 0; t.y = 0; t.width = 100; t.autoSize = TextFieldAutoSize.CENTER; t.text = st; // var textFormat:TextFormat = new TextFormat(); textFormat.font = quot;Lucida Grandequot;; textFormat.color = 0xFFFFFF; textFormat.size = 12; t.setTextFormat(textFormat); s.addChild(t); return s; } } }