SlideShare a Scribd company logo
1 of 20
Download to read offline
www.inazumatv.com/contents/

       me.beginsprite.com
2011   7   2
www.sidevision.co.jp

2011   7   2
Signals
               Event

2011   7   2
Flash   Event
               Events




2011   7   2
Event
       Event




       Event
2011   7   2
01 Sample


 start_btn.addEventListener(MouseEvent.CLICK, onStartClicked);
 stop_btn.addEventListener(MouseEvent.CLICK, onStopClicked);

  function onStartClicked (e:MouseEvent):void {
  	 addEventListener(Event.EXIT_FRAME, onLoop);
  }
  function onStopClicked (e:MouseEvent):void {
  	 removeEventListener(Event.EXIT_FRAME, onLoop);
  }
  function onLoop (e:Event):void {
  	 fan_mc.rotation += 5;
  }
2011   7   2
01 Sample




  addEventListener(Event.EXIT_FRAME, onLoop);


               removeEventListener(Event.EXIT_FRAME, onLoop);




2011   7   2
02 Sample

 package com.inazumatv.events
 {
 import flash.events.Event;

 public class FanEvent extends Event
 {
 	   public static const FAN_START:String = "fanStart";
 	   public static const FAN_STOP:String = "fanStop";
 	
 	   public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
 	   {
 	   	    super(type, bubbles, cancelable);
 	   }
 	
 	   override public function clone():Event
 	   {
 	   	    return new FanEvent(type, bubbles, cancelable);
 	   }
 }
 }


2011   7   2
02 Sample

 package com.inazumatv.events
 {
 import flash.events.Event;

 public class FanEvent extends Event
 {
 	   public static const FAN_START:String = "fanStart";
 	   public static const FAN_STOP:String = "fanStop";
 	
 	   public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
 	   {
 	   	    super(type, bubbles, cancelable);
 	   }
 	
 	   override public function clone():Event
 	   {
 	   	    return new FanEvent(type, bubbles, cancelable);
 	   }
 }
 }


2011   7   2
03 Sample
 package com.inazumatv.events
 {
 import flash.events.Event;

 public class FanSpeedEvent extends Event
 {
 	
 	    public static const CHANGE_SPEED:String = "changeSpeed";
 	    private var _speed:Number;
 	
 	    public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false)
 	    {
 	    	     _speed = speed;
 	    	     super(type, bubbles, cancelable);
 	    }
 	
 	    override public function clone():Event
 	    {
 	    	     return new FanSpeedEvent(speed, type, bubbles, cancelable);
 	    }
 	
 	    override public function toString():String
 	    {
 	    	     return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase")
 	    }
 	
 	    public function get speed():Number
 	    {
 	    	     return _speed;
 	    }
 }
 }
2011   7   2
03 Sample
 package com.inazumatv.events
 {
 import flash.events.Event;

 public class FanSpeedEvent extends Event
 {
 	
 	    public static const CHANGE_SPEED:String = "changeSpeed";
 	    private var _speed:Number;
 	
 	    public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false)
 	    {
 	    	     _speed = speed;
 	    	     super(type, bubbles, cancelable);
 	    }
 	
 	    override public function clone():Event
 	    {
 	    	     return new FanSpeedEvent(speed, type, bubbles, cancelable);
 	    }
 	
 	    override public function toString():String
 	    {
 	    	     return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase")
 	    }
 	
 	    public function get speed():Number
 	    {
 	    	     return _speed;
 	    }
 }
 }
2011   7   2
Signals
               Event

2011   7   2
Signals
       addEventListener(listener:Function)
       removeEventListener(listener:Function)
       dispatchEvent(new ExampleEvent(ExampleEvent.EVENT_TYPE))



       add(listener:Function)
       addOnce(listener:Function)
       remove(listener:Function)
       removeAll()
       dispatch(... valueObjects)
2011   7   2
Signals
       add(listener:Function)
       addOnce(listener:Function)
       remove(listener:Function)
       removeAll()
       dispatch(... valueObjects)



       addWithPriority(listener:Function, priority:int=0)	
       addOnceWithPriority(listener:Function, priority:int=0)


2011   7   2
Signals
       if (stage)
       	 init();
       else
       	 new NativeSignal(this,
        	 	 	 Event.ADDED_TO_STAGE,
        	 	 	 Event
       	 ).addOnce(init);



       init

2011   7   2
Signals
   var accelerate:Signal = new Signal(Number);
   accelerate.dispatch(speed);

   function onAccelerate(speed:Number) {
   }
   accelerate.add(onAccelerate);




2011   7   2
Signals
               NativeSignal
               Signal
               DeluxeSignal

                      Class

2011   7   2
Signals
           github : as3-signals
           https://github.com/robertpenner/as3-signals

       Robert Penner
       Programming Macromedia Flash MX

       mx.motion.easing.*
       fl.motion.easing.*



2011   7   2
Signals
   github : as3-signals
   https://github.com/robertpenner/as3-signals/wiki
   https://github.com/robertpenner/as3-signals/wiki/_pages




   http://www.himco.jp/articles.php

   inzumatv.com
   http://www.inazumatv.com/contents/archives/tag/signals




2011   7   2
www.inazumatv.com/contents/
               me.beginsprite.com
               www.sidevision.co.jp



                            @taikiken
2011   7   2

More Related Content

What's hot

The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]Nilhcem
 
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
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
 
openFrameworks 007 - events
openFrameworks 007 - eventsopenFrameworks 007 - events
openFrameworks 007 - eventsroxlu
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear EssentialsNilhcem
 
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversMingHo Chang
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3martha leon
 
Async JavaScript in ES7
Async JavaScript in ES7Async JavaScript in ES7
Async JavaScript in ES7Mike North
 
知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tipsikeyat
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257newegg
 
Applet 2 container and action_listener
Applet 2 container and action_listenerApplet 2 container and action_listener
Applet 2 container and action_listenerNitigan Nakjuatong
 
Reactive computing
Reactive computingReactive computing
Reactive computingStan Lea
 
The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210Mahmoud Samir Fayed
 
Promises in iOS development
Promises in iOS developmentPromises in iOS development
Promises in iOS developmentRomanPanichkin
 
Windows 10 - one application for all platforms. (UA Mobile 2016)
Windows 10 - one application for all platforms. (UA Mobile 2016)Windows 10 - one application for all platforms. (UA Mobile 2016)
Windows 10 - one application for all platforms. (UA Mobile 2016)Mykyta Bondarenko
 
Griffon不定期便〜G*ワークショップ編〜
Griffon不定期便〜G*ワークショップ編〜Griffon不定期便〜G*ワークショップ編〜
Griffon不定期便〜G*ワークショップ編〜Kiyotaka Oku
 

What's hot (20)

culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
Iniciación rx java
Iniciación rx javaIniciación rx java
Iniciación rx java
 
The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [MOBILIZATION]
 
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
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014
 
openFrameworks 007 - events
openFrameworks 007 - eventsopenFrameworks 007 - events
openFrameworks 007 - events
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear Essentials
 
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
 
Async JavaScript in ES7
Async JavaScript in ES7Async JavaScript in ES7
Async JavaScript in ES7
 
知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips知っておきたいSpring Batch Tips
知っておきたいSpring Batch Tips
 
Calculon
CalculonCalculon
Calculon
 
Activities
ActivitiesActivities
Activities
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
 
Applet 2 container and action_listener
Applet 2 container and action_listenerApplet 2 container and action_listener
Applet 2 container and action_listener
 
Reactive computing
Reactive computingReactive computing
Reactive computing
 
The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210
 
Promises in iOS development
Promises in iOS developmentPromises in iOS development
Promises in iOS development
 
Windows 10 - one application for all platforms. (UA Mobile 2016)
Windows 10 - one application for all platforms. (UA Mobile 2016)Windows 10 - one application for all platforms. (UA Mobile 2016)
Windows 10 - one application for all platforms. (UA Mobile 2016)
 
Griffon不定期便〜G*ワークショップ編〜
Griffon不定期便〜G*ワークショップ編〜Griffon不定期便〜G*ワークショップ編〜
Griffon不定期便〜G*ワークショップ編〜
 

Viewers also liked

iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とか
iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とかiOSデバイスの対応OSと画面サイズとかCPUとか発売時期とか
iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とかHiroaki Okubo
 
Signalsで Event処理を簡単に
Signalsで Event処理を簡単にSignalsで Event処理を簡単に
Signalsで Event処理を簡単にHiroaki Okubo
 
めんどうな viewport や 端末判別の ために sagen.js
めんどうな viewport や 端末判別の ために sagen.jsめんどうな viewport や 端末判別の ために sagen.js
めんどうな viewport や 端末判別の ために sagen.jsHiroaki Okubo
 
HTML5 Video Player #fsync
HTML5 Video Player #fsyncHTML5 Video Player #fsync
HTML5 Video Player #fsyncHiroaki Okubo
 
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...KickApps SF Summit - "Open Remarks on where we stand in the world of social m...
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...KickApps
 
DelveNYC: Flash Catalyst
DelveNYC: Flash CatalystDelveNYC: Flash Catalyst
DelveNYC: Flash CatalystRyan Stewart
 
Being an effective_seo_within_your_or-tony_adam
Being an effective_seo_within_your_or-tony_adamBeing an effective_seo_within_your_or-tony_adam
Being an effective_seo_within_your_or-tony_adamzachbrowne
 
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather Bernett
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather BernettKickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather Bernett
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather BernettKickApps
 

Viewers also liked (9)

iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とか
iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とかiOSデバイスの対応OSと画面サイズとかCPUとか発売時期とか
iOSデバイスの対応OSと画面サイズとかCPUとか発売時期とか
 
Signalsで Event処理を簡単に
Signalsで Event処理を簡単にSignalsで Event処理を簡単に
Signalsで Event処理を簡単に
 
めんどうな viewport や 端末判別の ために sagen.js
めんどうな viewport や 端末判別の ために sagen.jsめんどうな viewport や 端末判別の ために sagen.js
めんどうな viewport や 端末判別の ために sagen.js
 
HTML5 Video Player #fsync
HTML5 Video Player #fsyncHTML5 Video Player #fsync
HTML5 Video Player #fsync
 
HTML5 Video Player
HTML5 Video PlayerHTML5 Video Player
HTML5 Video Player
 
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...KickApps SF Summit - "Open Remarks on where we stand in the world of social m...
KickApps SF Summit - "Open Remarks on where we stand in the world of social m...
 
DelveNYC: Flash Catalyst
DelveNYC: Flash CatalystDelveNYC: Flash Catalyst
DelveNYC: Flash Catalyst
 
Being an effective_seo_within_your_or-tony_adam
Being an effective_seo_within_your_or-tony_adamBeing an effective_seo_within_your_or-tony_adam
Being an effective_seo_within_your_or-tony_adam
 
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather Bernett
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather BernettKickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather Bernett
KickApps SF Summit - "Dell's thoughts on Social Leadgen", by Heather Bernett
 

Similar to Flash Event Handling and Signals in ActionScript 3

There is something about Event
There is something about EventThere is something about Event
There is something about EventEddie Kao
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at NetflixC4Media
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsPeter-Paul Koch
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in javaGoogle
 
activity_and_fragment_may_2020_lakopi
activity_and_fragment_may_2020_lakopiactivity_and_fragment_may_2020_lakopi
activity_and_fragment_may_2020_lakopiToru Wonyoung Choi
 
The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]Nilhcem
 
Testing Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaTesting Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaFabio Collini
 
Trisha gee concurrentprogrammingusingthedisruptor
Trisha gee concurrentprogrammingusingthedisruptorTrisha gee concurrentprogrammingusingthedisruptor
Trisha gee concurrentprogrammingusingthedisruptorEthanTu
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptxGood657694
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196Mahmoud Samir Fayed
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingPayal Dungarwal
 
The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189Mahmoud Samir Fayed
 

Similar to Flash Event Handling and Signals in ActionScript 3 (20)

There is something about Event
There is something about EventThere is something about Event
There is something about Event
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript Events
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
activity_and_fragment_may_2020_lakopi
activity_and_fragment_may_2020_lakopiactivity_and_fragment_may_2020_lakopi
activity_and_fragment_may_2020_lakopi
 
The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]
 
Testing Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJavaTesting Android apps based on Dagger and RxJava
Testing Android apps based on Dagger and RxJava
 
Trisha gee concurrentprogrammingusingthedisruptor
Trisha gee concurrentprogrammingusingthedisruptorTrisha gee concurrentprogrammingusingthedisruptor
Trisha gee concurrentprogrammingusingthedisruptor
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Ext J S Observable
Ext J S ObservableExt J S Observable
Ext J S Observable
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
 
662305 11
662305 11662305 11
662305 11
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.7 book - Part 16 of 196
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.6 book - Part 15 of 189
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Flash Event Handling and Signals in ActionScript 3

  • 1. www.inazumatv.com/contents/ me.beginsprite.com 2011 7 2
  • 3. Signals Event 2011 7 2
  • 4. Flash Event Events 2011 7 2
  • 5. Event Event Event 2011 7 2
  • 6. 01 Sample start_btn.addEventListener(MouseEvent.CLICK, onStartClicked); stop_btn.addEventListener(MouseEvent.CLICK, onStopClicked); function onStartClicked (e:MouseEvent):void { addEventListener(Event.EXIT_FRAME, onLoop); } function onStopClicked (e:MouseEvent):void { removeEventListener(Event.EXIT_FRAME, onLoop); } function onLoop (e:Event):void { fan_mc.rotation += 5; } 2011 7 2
  • 7. 01 Sample addEventListener(Event.EXIT_FRAME, onLoop); removeEventListener(Event.EXIT_FRAME, onLoop); 2011 7 2
  • 8. 02 Sample package com.inazumatv.events { import flash.events.Event; public class FanEvent extends Event { public static const FAN_START:String = "fanStart"; public static const FAN_STOP:String = "fanStop"; public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); } override public function clone():Event { return new FanEvent(type, bubbles, cancelable); } } } 2011 7 2
  • 9. 02 Sample package com.inazumatv.events { import flash.events.Event; public class FanEvent extends Event { public static const FAN_START:String = "fanStart"; public static const FAN_STOP:String = "fanStop"; public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); } override public function clone():Event { return new FanEvent(type, bubbles, cancelable); } } } 2011 7 2
  • 10. 03 Sample package com.inazumatv.events { import flash.events.Event; public class FanSpeedEvent extends Event { public static const CHANGE_SPEED:String = "changeSpeed"; private var _speed:Number; public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false) { _speed = speed; super(type, bubbles, cancelable); } override public function clone():Event { return new FanSpeedEvent(speed, type, bubbles, cancelable); } override public function toString():String { return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase") } public function get speed():Number { return _speed; } } } 2011 7 2
  • 11. 03 Sample package com.inazumatv.events { import flash.events.Event; public class FanSpeedEvent extends Event { public static const CHANGE_SPEED:String = "changeSpeed"; private var _speed:Number; public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false) { _speed = speed; super(type, bubbles, cancelable); } override public function clone():Event { return new FanSpeedEvent(speed, type, bubbles, cancelable); } override public function toString():String { return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase") } public function get speed():Number { return _speed; } } } 2011 7 2
  • 12. Signals Event 2011 7 2
  • 13. Signals addEventListener(listener:Function) removeEventListener(listener:Function) dispatchEvent(new ExampleEvent(ExampleEvent.EVENT_TYPE)) add(listener:Function) addOnce(listener:Function) remove(listener:Function) removeAll() dispatch(... valueObjects) 2011 7 2
  • 14. Signals add(listener:Function) addOnce(listener:Function) remove(listener:Function) removeAll() dispatch(... valueObjects) addWithPriority(listener:Function, priority:int=0) addOnceWithPriority(listener:Function, priority:int=0) 2011 7 2
  • 15. Signals if (stage) init(); else new NativeSignal(this, Event.ADDED_TO_STAGE, Event ).addOnce(init); init 2011 7 2
  • 16. Signals var accelerate:Signal = new Signal(Number); accelerate.dispatch(speed); function onAccelerate(speed:Number) { } accelerate.add(onAccelerate); 2011 7 2
  • 17. Signals NativeSignal Signal DeluxeSignal Class 2011 7 2
  • 18. Signals github : as3-signals https://github.com/robertpenner/as3-signals Robert Penner Programming Macromedia Flash MX mx.motion.easing.* fl.motion.easing.* 2011 7 2
  • 19. Signals github : as3-signals https://github.com/robertpenner/as3-signals/wiki https://github.com/robertpenner/as3-signals/wiki/_pages http://www.himco.jp/articles.php inzumatv.com http://www.inazumatv.com/contents/archives/tag/signals 2011 7 2
  • 20. www.inazumatv.com/contents/ me.beginsprite.com www.sidevision.co.jp @taikiken 2011 7 2