SlideShare ist ein Scribd-Unternehmen logo
1 von 52
package {

   import   flash.display.Sprite;

   import   flash.display.StageAlign;

   import   flash.display.StageScaleMode;

   import   flash.events.MouseEvent;


   public   class SwcTest extends Sprite

   {

   
        private var _test:SwcClassTest = new SwcClassTest;

   

   
        public function SwcTest()

   
        {

   
        
     //

   
        
     stage.align = StageAlign.TOP_LEFT;

   
        
     stage.scaleMode = StageScaleMode.NO_SCALE;

   
        
     //

   
        
     _test.x = stage.stageWidth/2;

   
        
     _test.y = stage.stageHeight/2;

   
        
     this.addChild(_test);

   
        
     //

   
        
     _test.circle.buttonMode = true;

   
        
     _test.rect.buttonMode = true;

   
        
     //

   
        
     _test.circle.addEventListener(MouseEvent.CLICK,clickCircleHandler);

   
        
     _test.rect.addEventListener(MouseEvent.CLICK, clickRectHandler);

   
        }
//Circle

   
        private function clickCircleHandler(event:MouseEvent):void

   
        {
        //

   
        
     _test.message.text = "Circle";

   
        }

   
        //Rect

   
        private function clickRectHandler(event:MouseEvent):void

   
        {
        //

   
        
     _test.message.text = "Rect";

   
        }

   }
}
package {

   import fl.events.SliderEvent;


   import flash.display.Sprite;

   import flash.display.StageAlign;

   import flash.display.StageScaleMode;

   import flash.events.Event;


   [SWF(backgroundColor="#FFFFFF", frameRate="60")]


   public   class GuiComponent extends Sprite

   {

   
        private var spin:Spin = new Spin();

   
        private var ui:UserInterface = new UserInterface();

   
        private var rotateSpeed:Number = 0;

   

   
        public function GuiComponent()

   
        {

   
        
     //
        stage.align = StageAlign.TOP_LEFT;
        stage.scaleMode = StageScaleMode.NO_SCALE;
        //Spin

   
        
    this.addChild(spin);

   
        
    spin.x = stage.stageWidth/2;

   
        
    spin.y = stage.stageHeight/2;

   
        
    this.addEventListener(Event.ENTER_FRAME, update);
//UserIntaface

   
       
   this.addChild(ui);

   
       
   ui.x = 20;

   
       
   ui.y = 20;

   
       
   //

   
       
   ui.speedSlider.minimum = 0;

   
       
   ui.speedSlider.maximum = 100;

   
       
   ui.speedSlider.liveDragging = true;

   
       
   ui.radiusSlider.minimum = 0;

   
       
   ui.radiusSlider.maximum = 100;

   
       
   ui.radiusSlider.value = 10;

   
       
   ui.radiusSlider.liveDragging =true;

   
       
   ui.alphaSlider.minimum = 0;

   
       
   ui.alphaSlider.maximum = 100;

   
       
   ui.alphaSlider.value = 100;

   
       
   ui.alphaSlider.liveDragging = true;

   
       
   //UserInterface

   
       
   ui.speedSlider.addEventListener
                      (SliderEvent.CHANGE, speedSliderChangeHanlder);

   
       
   ui.radiusSlider.addEventListener
                      (SliderEvent.CHANGE, radiusSliderChangeHanlder);
        
   
   
     ui.alphaSlider.addEventListener
                      (SliderEvent.CHANGE, alphaSliderChangeHanlder);

   
       }
//

   
   //

   
   private function update(event:Event):void

   
   {

   
   
     spin.rotation += rotateSpeed;
    
   

   
   }

   
   //Speed

   
   private function speedSliderChangeHanlder(event:SliderEvent):void

   
   {

   
   
     rotateSpeed = ui.speedSlider.value;

   
   }

   
   //Radius

   
   private function radiusSliderChangeHanlder(event:SliderEvent):void

   
   {

   
   
     spin.scaleX = spin.scaleY = ui.radiusSlider.value / 10.0;

   
   }

   
   //Alpha

   
   private function alphaSliderChangeHanlder(event:SliderEvent):void

   
   {

   
   
     spin.alpha = ui.alphaSlider.value / 100;

  

   
   }

   }
}
package {

 import flash.display.*;


 [SWF(backgroundColor="#000000", frameRate="30")]


 public class DrawParticle extends Sprite

 {

 
 public function DrawParticle()

 
 {
     
    

 
 
      stage.align = StageAlign.TOP_LEFT;

 
 
      stage.scaleMode = StageScaleMode.NO_SCALE;

 
 
 

 
      //200

 
   
   for(var i:uint = 0; i < 200; i++){

 
   
   
     //       Circle

 
   
   
    var myParticle:Particle = new Particle();

 
   
   
    addChild(myParticle); //

 
   
   }

 
   }

 }
}
package {

 import flash.display.Sprite;

 import flash.events.Event;


   public class Particle extends Sprite {

   
 private var _speedX:Number;

   
 private var _speedY:Number;

   
 private var _scale:Number;

   

   
 public function Particle()

   
 {

   
 
       super();

   
 
       _speedX = rand(-8,8);

   
 
       _speedY = rand(-8,8);

   
 
       _scale = rand(0.1, 1.0);

   
 
       var cp:CircleParticle = new CircleParticle;

   
 
       cp.scaleX = cp.scaleY = _scale;

   
 
       cp.cacheAsBitmap = true;

   
 
       this.addChild(cp);

   
 
       this.addEventListener(Event.ENTER_FRAME, update);

   
 
       this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

   
 }


   
   private function addedHandler(event:Event):void

   
   {

   
   
     x = Math.random() * stage.stageWidth;

   
   
     y = Math.random() * stage.stageHeight;
private function update(event:Event):void

   
   {

   
   
     limit();

   
   
     x += _speedX;

   
   
     y += _speedY;

   
   }

   

   
   //

   
   private function limit():void

   
   {

   
   
     if(x < 0 || x > stage.stageWidth){

   
   
     
     _speedX *= -1;

   
   
     }

   
   
     if(y < 0 || y > stage.stageHeight){

   
   
     
     _speedY *= -1;

   
   
     }

   
   }

   

   
   //

   
   private function rand(min:Number, max:Number):Number

   
   {

   
   
     var randValue:Number = Math.random() * (max - min) + min;

   
   
     return randValue;

   
   }

   }
}
• Tween
• Tween
   • 2
   •
• Flash        Tween
• TweenMax
   •
   •
      • http://blog.greensock.com/tweenmaxas3/
   •                                    gs
• TweenMax
• TweeMax
  import gs.TweenMax;
  import gs.easing.*;
• Tween                     Tween
  TweenMax.to(          ,     ,{    });
•
    • TweenMaxAS3_Basics.swf
package {

 import flash.display.*;


 [SWF(backgroundColor="#000000", frameRate="30")]


 public class TweenParticle extends Sprite
  {

 
 public function TweenParticle()

 
 {
     
    

 
 
      stage.align = StageAlign.TOP_LEFT;

 
 
      stage.scaleMode = StageScaleMode.NO_SCALE;

 
 
 

 
      //200

 
   
   for(var i:uint = 0; i < 200; i++){

 
   
   
     //       Circle

 
   
   
    var myParticle:Particle = new Particle();

 
   
   
    addChild(myParticle); //

 
   
   }

 
   }

 }
}
package {

 import com.greensock.TweenMax;

 import com.greensock.easing.*;


 import flash.display.Sprite;

 import flash.events.Event;


 public class Particle extends Sprite {


   
   private var _speedX:Number;

   
   private var _speedY:Number;

   
   private var _scale:Number;

   

   
   public function Particle()

   
   {

   
   
     super();

   
   
     _speedX = rand(-8,8);

   
   
     _speedY = rand(-8,8);

   
   
     _scale = rand(0.2, 1.0);

   
   
     var cp:CircleParticle = new CircleParticle;

   
   
     cp.scaleX = cp.scaleY = _scale;

   
   
     cp.cacheAsBitmap = true;

   
   
     this.addChild(cp);

   
   
     this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

   
   }
private function tweenMe():void

 
     {

 
     
     //

 
     
    var toX:Number = rand(0, stage.stageWidth);

 
     
    var toY:Number = rand(0, stage.stageHeight);

 
     
    //Tween

 
     
    TweenMax.to(this, rand(2,3),
                      {x:toX, y:toY, ease:Sine.easeInOut, onComplete:tweenMe});

   
   }

   

   
   private function addedHandler(event:Event):void

   
   {

   
   
     x = Math.random() * stage.stageWidth;

   
   
     y = Math.random() * stage.stageHeight;

   
   
     TweenMax.to(this, 0,
                          {delay:rand(0,4),onComplete:tweenMe});

   
   }

   

   
   private function update(event:Event):void

   
   {

   
   
     limit();

   
   
     x += _speedX;

   
   
     y += _speedY;

   
   }
//

   
   private function limit():void

   
   {

   
   
     if(x < 0 || x > stage.stageWidth){

   
   
     
     _speedX *= -1;

   
   
     }

   
   
     if(y < 0 || y > stage.stageHeight){

   
   
     
     _speedY *= -1;

   
   
     }

   
   }

   

   
   //

   
   private function rand(min:Number, max:Number):Number

   
   {

   
   
     var randValue:Number = Math.random() * (max - min) + min;

   
   
     return randValue;

   
   }

   }
}
package {

 import flash.display.*;

 import flash.events.Event;

 import flash.events.MouseEvent;


 [SWF(backgroundColor="#CCCCCC", frameRate="30")]


 public class Portfolio extends Sprite

 {

 
  private var _background:BackgroundImage = new BackgroundImage;

 
  private var _menu:Menu = new Menu;

 
  private var _top:Top;

 
  private var _bio:Biography;

 
  private var _works:Works;

 

 
  public function Portfolio()

 
  {

 
  
      stage.align = StageAlign.TOP_LEFT;

 
  
      stage.scaleMode = StageScaleMode.NO_SCALE;

 
  

 
  
      this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

 
  

 
  
      //

 
   
    this.addChild(_background);

 
   
    //Menu

 
   
    _menu.x = 20;

 
   
    _menu.y = 20;

 
   
    this.addChild(_menu);
//Menu

   
   
     _menu.menu1.buttonMode = true;

   
   
     _menu.menu2.buttonMode = true;

   
   
     _menu.menu3.buttonMode = true;

   
   
     _menu.menu1.gotoAndStop(1);

   
   
     _menu.menu2.gotoAndStop(1);

   
   
     _menu.menu3.gotoAndStop(1);

   
   
     //

   
   
     _menu.menu1.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler);

   
   
     _menu.menu1.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler);

   
   
     _menu.menu1.addEventListener(MouseEvent.CLICK, menu1ClickHandler);

   
   
     _menu.menu2.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler);

   
   
     _menu.menu2.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler);

   
   
     _menu.menu2.addEventListener(MouseEvent.CLICK, menu2ClickHandler);

   
   
     _menu.menu3.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler);

   
   
     _menu.menu3.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler);

   
   
     _menu.menu3.addEventListener(MouseEvent.CLICK, menu3ClickHandler);

   
   
     //Top    

    
     
     
    

 
     
     _top = new Top(this);

 
     
     this.addChild(_top);

 
     }


 
     public function get menu():Menu {

 
     
     return _menu;

 
     }
private function addedHandler(event:Event):void

   
   {

   
   
     _background.width = stage.stageWidth;

   
   
     _background.height = stage.stageHeight;

   
   
     stage.addEventListener(Event.RESIZE, reseizeHandler);

   
   }

   

   
   private function reseizeHandler(event:Event):void

   
   {

   
   
     _background.width = stage.stageWidth;

   
   
     _background.height = stage.stageHeight;

   
   }

   

   
   private function menuRollOverHandler(event:MouseEvent):void

   
   {

   
   
     event.target.gotoAndStop(2);

   
   }

   
   private function menuRollOutHandler(event:MouseEvent):void

   
   {

   
   
     event.target.gotoAndStop(1);

   
   }

   
   private function menu1ClickHandler(event:MouseEvent):void

   
   {

   
   
     this.removeChildAt(2);

   
   
     //Top       

    
    
     
     

 
     
     _top = new Top(this);

 
     
     this.addChild(_top);

 
     }
private function menu2ClickHandler(event:MouseEvent):void

   
   {

   
   
     this.removeChildAt(2);

   
   
     //Bio      

    
     
     
     

   
   
     _bio = new Biography(this);

   
   
     this.addChild(_bio);

   
   }

   
   private function menu3ClickHandler(event:MouseEvent):void

   
   {

   
   
     this.removeChildAt(2);

   
   
     //Works

   
   
    _works = new Works(this);

   
   
    this.addChild(_works);

   
   }

   }
}
package
{

 import   com.greensock.TweenMax;

 import   com.greensock.easing.*;

 import   flash.display.Sprite;

 import   flash.events.Event;


 public class Top extends Sprite

 {

 
  private var _main:Portfolio;

 
  public function Top(main:Portfolio)

 
  {

 
  
      super();

 
  
      _main = main;

 
  
      var _content:TopMc = new TopMc;

 
  
      this.alpha = 0;

 
  
      this.addChild(_content);

 
  
      this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

 
  }

 

 
  private function addedHandler(event:Event):void

 
  {

 
  
      this.x = 140;

 
  
      this.y = 100;

 
  
      TweenMax.to(this, 1,
                   {y:20, alpha:1, delay:1, ease:Quint.easeOut});
 
 

 
  }

 }
package
{

 import   com.greensock.TweenMax;

 import   com.greensock.easing.*;

 import   flash.display.Sprite;

 import   flash.events.Event;


 public class Biography extends Sprite

 {

 
  private var _main:Portfolio;

 
  public function Biography(main:Portfolio)

 
  {

 
  
      super();

 
  
      _main = main;

 
  
      var _content:BiographyMc = new BiographyMc;

 
  
      this.addChild(_content);

 
  
      this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

 
  
      this.alpha=0;

 
  }

 

 
  private function addedHandler(event:Event):void

 
  {

 
  
      this.x = 140;

 
  
      this.y = 100;

 
  
      TweenMax.to(this, 1,
                   {y:20, alpha:1, delay:1, ease:Quint.easeOut});
 
 

 
  }

 }
package
{

 import   com.greensock.TweenMax;

 import   com.greensock.easing.*;

 import   flash.display.Sprite;

 import   flash.events.Event;


 public class Works extends Sprite

 {

 
  private var _main:Portfolio;

 
  public function Works(main:Portfolio)

 
  {

 
  
      super();

 
  
      _main = main;

 
  
      var _content:WorksMc = new WorksMc;

 
  
      this.addChild(_content);

 
  
      this.addEventListener(Event.ADDED_TO_STAGE, addedHandler);

 
  
      this.alpha = 0;

 
  }

 

 
  private function addedHandler(event:Event):void

 
  {

 
  
      this.x = 140;

 
  
      this.y = 100;

 
  
      TweenMax.to(this, 1,
                   {y:20, alpha:1, delay:1, ease:Quint.easeOut});
 
 
   

 
  }

 }
Sbaw091117

Weitere ähnliche Inhalte

Was ist angesagt?

LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellDroidConTLV
 
Automated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.xAutomated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.xTatsuya Maki
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScriptAndrew Dupont
 
Blending Culture in Twitter Client
Blending Culture in Twitter ClientBlending Culture in Twitter Client
Blending Culture in Twitter ClientKenji Tanaka
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android DevelopmentJussi Pohjolainen
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsPeter-Paul Koch
 
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法Kenji Tanaka
 
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。Kenji Tanaka
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210Mahmoud Samir Fayed
 
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
 
Awesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom LibrariesAwesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom LibrariesFITC
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202Mahmoud Samir Fayed
 
C# Delegates, Events, Lambda
C# Delegates, Events, LambdaC# Delegates, Events, Lambda
C# Delegates, Events, LambdaJussi Pohjolainen
 
Data20161007
Data20161007Data20161007
Data20161007capegmail
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAgus Haryanto
 

Was ist angesagt? (20)

LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
 
Automated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.xAutomated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.x
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
 
Blending Culture in Twitter Client
Blending Culture in Twitter ClientBlending Culture in Twitter Client
Blending Culture in Twitter Client
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript Events
 
Cyclejs introduction
Cyclejs introductionCyclejs introduction
Cyclejs introduction
 
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
VC「もしかして...」Model「私たち...」「「入れ替わってるー!?」」を前前前世から防ぐ方法
 
節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。節子、それViewControllerやない...、FatViewControllerや...。
節子、それViewControllerやない...、FatViewControllerや...。
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
 
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
 
Awesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom LibrariesAwesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom Libraries
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
 
C# Delegates, Events, Lambda
C# Delegates, Events, LambdaC# Delegates, Events, Lambda
C# Delegates, Events, Lambda
 
Data20161007
Data20161007Data20161007
Data20161007
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 
I os 15
I os 15I os 15
I os 15
 
Events
EventsEvents
Events
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation Drawer
 

Ähnlich wie Sbaw091117

Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLgerbille
 
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationCQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationSamuel ROZE
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingSamuel ROZE
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfJUSTSTYLISH3B2MOHALI
 
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
 
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M google play service 7.8 & new tech in M
google play service 7.8 & new tech in M Ted Liang
 
Signalsで Event処理を簡単に
Signalsで Event処理を簡単にSignalsで Event処理を簡単に
Signalsで Event処理を簡単にHiroaki Okubo
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloRobert Nyman
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at NackademinRobert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileRobert Nyman
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresRobert Nyman
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfanjandavid
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoRobert Nyman
 

Ähnlich wie Sbaw091117 (20)

Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
 
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationCQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
 
Java awt
Java awtJava awt
Java awt
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event Sourcing
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
 
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
 
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
 
Signalsで Event処理を簡単に
Signalsで Event処理を簡単にSignalsで Event処理を簡単に
Signalsで Event処理を簡単に
 
2011 07-hiyoko
2011 07-hiyoko2011 07-hiyoko
2011 07-hiyoko
 
Android Animation (in tamil)
Android Animation (in tamil)Android Animation (in tamil)
Android Animation (in tamil)
 
Sbaw091110
Sbaw091110Sbaw091110
Sbaw091110
 
662305 11
662305 11662305 11
662305 11
 
#JavaFX.forReal()
#JavaFX.forReal()#JavaFX.forReal()
#JavaFX.forReal()
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at Nackademin
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
 
Package org dev
Package org devPackage org dev
Package org dev
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdf
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
 

Mehr von 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
 

Mehr von 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 複数のシーンの管理・切替え
 

Sbaw091117

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.MouseEvent; public class SwcTest extends Sprite { private var _test:SwcClassTest = new SwcClassTest; public function SwcTest() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; // _test.x = stage.stageWidth/2; _test.y = stage.stageHeight/2; this.addChild(_test); // _test.circle.buttonMode = true; _test.rect.buttonMode = true; // _test.circle.addEventListener(MouseEvent.CLICK,clickCircleHandler); _test.rect.addEventListener(MouseEvent.CLICK, clickRectHandler); }
  • 12. //Circle private function clickCircleHandler(event:MouseEvent):void { // _test.message.text = "Circle"; } //Rect private function clickRectHandler(event:MouseEvent):void { // _test.message.text = "Rect"; } } }
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. package { import fl.events.SliderEvent; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; [SWF(backgroundColor="#FFFFFF", frameRate="60")] public class GuiComponent extends Sprite { private var spin:Spin = new Spin(); private var ui:UserInterface = new UserInterface(); private var rotateSpeed:Number = 0; public function GuiComponent() { // stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //Spin this.addChild(spin); spin.x = stage.stageWidth/2; spin.y = stage.stageHeight/2; this.addEventListener(Event.ENTER_FRAME, update);
  • 20. //UserIntaface this.addChild(ui); ui.x = 20; ui.y = 20; // ui.speedSlider.minimum = 0; ui.speedSlider.maximum = 100; ui.speedSlider.liveDragging = true; ui.radiusSlider.minimum = 0; ui.radiusSlider.maximum = 100; ui.radiusSlider.value = 10; ui.radiusSlider.liveDragging =true; ui.alphaSlider.minimum = 0; ui.alphaSlider.maximum = 100; ui.alphaSlider.value = 100; ui.alphaSlider.liveDragging = true; //UserInterface ui.speedSlider.addEventListener (SliderEvent.CHANGE, speedSliderChangeHanlder); ui.radiusSlider.addEventListener (SliderEvent.CHANGE, radiusSliderChangeHanlder); ui.alphaSlider.addEventListener (SliderEvent.CHANGE, alphaSliderChangeHanlder); }
  • 21. // // private function update(event:Event):void { spin.rotation += rotateSpeed; } //Speed private function speedSliderChangeHanlder(event:SliderEvent):void { rotateSpeed = ui.speedSlider.value; } //Radius private function radiusSliderChangeHanlder(event:SliderEvent):void { spin.scaleX = spin.scaleY = ui.radiusSlider.value / 10.0; } //Alpha private function alphaSliderChangeHanlder(event:SliderEvent):void { spin.alpha = ui.alphaSlider.value / 100; } } }
  • 22.
  • 23.
  • 24.
  • 25. package { import flash.display.*; [SWF(backgroundColor="#000000", frameRate="30")] public class DrawParticle extends Sprite { public function DrawParticle() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //200 for(var i:uint = 0; i < 200; i++){ // Circle var myParticle:Particle = new Particle(); addChild(myParticle); // } } } }
  • 26. package { import flash.display.Sprite; import flash.events.Event; public class Particle extends Sprite { private var _speedX:Number; private var _speedY:Number; private var _scale:Number; public function Particle() { super(); _speedX = rand(-8,8); _speedY = rand(-8,8); _scale = rand(0.1, 1.0); var cp:CircleParticle = new CircleParticle; cp.scaleX = cp.scaleY = _scale; cp.cacheAsBitmap = true; this.addChild(cp); this.addEventListener(Event.ENTER_FRAME, update); this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); } private function addedHandler(event:Event):void { x = Math.random() * stage.stageWidth; y = Math.random() * stage.stageHeight;
  • 27. private function update(event:Event):void { limit(); x += _speedX; y += _speedY; } // private function limit():void { if(x < 0 || x > stage.stageWidth){ _speedX *= -1; } if(y < 0 || y > stage.stageHeight){ _speedY *= -1; } } // private function rand(min:Number, max:Number):Number { var randValue:Number = Math.random() * (max - min) + min; return randValue; } } }
  • 28.
  • 29. • Tween • Tween • 2 • • Flash Tween • TweenMax • • • http://blog.greensock.com/tweenmaxas3/ • gs
  • 30. • TweenMax • TweeMax import gs.TweenMax; import gs.easing.*; • Tween Tween TweenMax.to( , ,{ });
  • 31. • TweenMaxAS3_Basics.swf
  • 32.
  • 33. package { import flash.display.*; [SWF(backgroundColor="#000000", frameRate="30")] public class TweenParticle extends Sprite { public function TweenParticle() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; //200 for(var i:uint = 0; i < 200; i++){ // Circle var myParticle:Particle = new Particle(); addChild(myParticle); // } } } }
  • 34. package { import com.greensock.TweenMax; import com.greensock.easing.*; import flash.display.Sprite; import flash.events.Event; public class Particle extends Sprite { private var _speedX:Number; private var _speedY:Number; private var _scale:Number; public function Particle() { super(); _speedX = rand(-8,8); _speedY = rand(-8,8); _scale = rand(0.2, 1.0); var cp:CircleParticle = new CircleParticle; cp.scaleX = cp.scaleY = _scale; cp.cacheAsBitmap = true; this.addChild(cp); this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); }
  • 35. private function tweenMe():void { // var toX:Number = rand(0, stage.stageWidth); var toY:Number = rand(0, stage.stageHeight); //Tween TweenMax.to(this, rand(2,3), {x:toX, y:toY, ease:Sine.easeInOut, onComplete:tweenMe}); } private function addedHandler(event:Event):void { x = Math.random() * stage.stageWidth; y = Math.random() * stage.stageHeight; TweenMax.to(this, 0, {delay:rand(0,4),onComplete:tweenMe}); } private function update(event:Event):void { limit(); x += _speedX; y += _speedY; }
  • 36. // private function limit():void { if(x < 0 || x > stage.stageWidth){ _speedX *= -1; } if(y < 0 || y > stage.stageHeight){ _speedY *= -1; } } // private function rand(min:Number, max:Number):Number { var randValue:Number = Math.random() * (max - min) + min; return randValue; } } }
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. package { import flash.display.*; import flash.events.Event; import flash.events.MouseEvent; [SWF(backgroundColor="#CCCCCC", frameRate="30")] public class Portfolio extends Sprite { private var _background:BackgroundImage = new BackgroundImage; private var _menu:Menu = new Menu; private var _top:Top; private var _bio:Biography; private var _works:Works; public function Portfolio() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); // this.addChild(_background); //Menu _menu.x = 20; _menu.y = 20; this.addChild(_menu);
  • 46. //Menu _menu.menu1.buttonMode = true; _menu.menu2.buttonMode = true; _menu.menu3.buttonMode = true; _menu.menu1.gotoAndStop(1); _menu.menu2.gotoAndStop(1); _menu.menu3.gotoAndStop(1); // _menu.menu1.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler); _menu.menu1.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler); _menu.menu1.addEventListener(MouseEvent.CLICK, menu1ClickHandler); _menu.menu2.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler); _menu.menu2.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler); _menu.menu2.addEventListener(MouseEvent.CLICK, menu2ClickHandler); _menu.menu3.addEventListener(MouseEvent.ROLL_OVER,menuRollOverHandler); _menu.menu3.addEventListener(MouseEvent.ROLL_OUT,menuRollOutHandler); _menu.menu3.addEventListener(MouseEvent.CLICK, menu3ClickHandler); //Top _top = new Top(this); this.addChild(_top); } public function get menu():Menu { return _menu; }
  • 47. private function addedHandler(event:Event):void { _background.width = stage.stageWidth; _background.height = stage.stageHeight; stage.addEventListener(Event.RESIZE, reseizeHandler); } private function reseizeHandler(event:Event):void { _background.width = stage.stageWidth; _background.height = stage.stageHeight; } private function menuRollOverHandler(event:MouseEvent):void { event.target.gotoAndStop(2); } private function menuRollOutHandler(event:MouseEvent):void { event.target.gotoAndStop(1); } private function menu1ClickHandler(event:MouseEvent):void { this.removeChildAt(2); //Top _top = new Top(this); this.addChild(_top); }
  • 48. private function menu2ClickHandler(event:MouseEvent):void { this.removeChildAt(2); //Bio _bio = new Biography(this); this.addChild(_bio); } private function menu3ClickHandler(event:MouseEvent):void { this.removeChildAt(2); //Works _works = new Works(this); this.addChild(_works); } } }
  • 49. package { import com.greensock.TweenMax; import com.greensock.easing.*; import flash.display.Sprite; import flash.events.Event; public class Top extends Sprite { private var _main:Portfolio; public function Top(main:Portfolio) { super(); _main = main; var _content:TopMc = new TopMc; this.alpha = 0; this.addChild(_content); this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); } private function addedHandler(event:Event):void { this.x = 140; this.y = 100; TweenMax.to(this, 1, {y:20, alpha:1, delay:1, ease:Quint.easeOut}); } }
  • 50. package { import com.greensock.TweenMax; import com.greensock.easing.*; import flash.display.Sprite; import flash.events.Event; public class Biography extends Sprite { private var _main:Portfolio; public function Biography(main:Portfolio) { super(); _main = main; var _content:BiographyMc = new BiographyMc; this.addChild(_content); this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); this.alpha=0; } private function addedHandler(event:Event):void { this.x = 140; this.y = 100; TweenMax.to(this, 1, {y:20, alpha:1, delay:1, ease:Quint.easeOut}); } }
  • 51. package { import com.greensock.TweenMax; import com.greensock.easing.*; import flash.display.Sprite; import flash.events.Event; public class Works extends Sprite { private var _main:Portfolio; public function Works(main:Portfolio) { super(); _main = main; var _content:WorksMc = new WorksMc; this.addChild(_content); this.addEventListener(Event.ADDED_TO_STAGE, addedHandler); this.alpha = 0; } private function addedHandler(event:Event):void { this.x = 140; this.y = 100; TweenMax.to(this, 1, {y:20, alpha:1, delay:1, ease:Quint.easeOut}); } }