SlideShare a Scribd company logo
AS3-Signals
An Introduction
        Samuel Asher Rivello
        Principal, Rivello Multimedia Consulting




                                                   info@RivelloMultimediaConsulting.com
                                                   TM & © 2011 Rivello Multimedia Consulting
Topic
        Speaker
          •Samuel Asher   Rivello is the principal of
          Rivello Multimedia Consulting (RMC). RMC’s Flash and Flex
          services include software architecture, consulting,
          development, and training. Sam has a decade of experience
          creating games and applications, and is currently traveling the
          globe to collaborate with top companies.

        Agenda
          •Learn   the benefits and syntax of AS3-Signals

        Audience
          •Intermediate    to Advanced ActionScript 3.0 Developers

        Take-Away
          •Allsource code and documentation will be available to
          attendees.




                                 info@RivelloMultimediaConsulting.com
                                 TM & © 2011 Rivello Multimedia Consulting
SECTION 1
What is AS3-Signals?




                       info@RivelloMultimediaConsulting.com
                       TM & © 2011 Rivello Multimedia Consulting
Agenda

Three Sections ~ 30 Minutes
   1.   What is AS3-Signals?
        •   Overview
        •   Implementation
   2.   AS3-Signals Applied
        •   Adding to a new project
        •   Types of Signals
   3.   Conclusion
        •   References
        •   Q&A


                                      info@RivelloMultimediaConsulting.com
                                      TM & © 2011 Rivello Multimedia Consulting
AS3-Signals

Overview
  AS3-Signals is an open-source pure AS3 library created
  by Robert Penner which facilitates messaging between
  objects. The 'signals' concept is inspired by C++.
  AS3-Signals can be used in place of or in addition to
  flash.events.Event.




                                        info@RivelloMultimediaConsulting.com
                                        TM & © 2011 Rivello Multimedia Consulting
DEMO
Let's See Traditional Flash Events
In Action!




                             info@RivelloMultimediaConsulting.com
                             TM & © 2011 Rivello Multimedia Consulting
Flash Events
 Drawbacks
        •   Must inherit or compose EventDispatcher
        •   Message types stored as error-prone Strings
        •   Has garbage-collection / clean-up issues
        •   Must subclass flash.events.Event to send custom
            data.*

   *Admittedly, with my preferred style of AS3-Signals, I do this too.




                                                                         info@RivelloMultimediaConsulting.com
                                                                     TM & © 2011 Rivello Multimedia Consulting
AS3-Signals
Benefits
        •   Requires no inheritance
        •   Fast to setup (even with custom data)
        •   Works well with native Flash Events (e.g.
            MouseEvent)
        •   A powerful addition Robotlegs framework*

   *An unrelated open-source AS3 framework (Robotlegs.org)




                                                             info@RivelloMultimediaConsulting.com
                                                             TM & © 2011 Rivello Multimedia Consulting
AS3-Signals
Syntax 1 – Pass No Data
   var signal = new Signal ();
   signal.add(_onSignalDispatched); //or signal.addOnce(_onSignalDispatched);
   signal.dispatch();


   private function _onSignalDispatched () : void
   {
       Trace (“onSignalDispatched: “);
   }




                                                        info@RivelloMultimediaConsulting.com
                                                        TM & © 2011 Rivello Multimedia Consulting
AS3-Signals
Syntax 2 – Pass Data
   var signal = new Signal (String, MyCustomClass);
   signal.add(_onSignalDispatched); //or signal.addOnce(_onSignalDispatched);
   signal.dispatch();


   private function _onSignalDispatched (s : String, c : MyCustomClass) : void
   {
       Trace (“onSignalDispatched: “ + s + “ and “ + c);
   }




                                                           info@RivelloMultimediaConsulting.com
                                                           TM & © 2011 Rivello Multimedia Consulting
AS3-Signals
Types of Signals
        •   Signal – Pass zero or more arguments
        •   DeluxeSignal – Pass GenericEvent (w/ target &
            Signal)
        •   NativeSignal – Connects a Signal with a Flash Event
            (e.g. MouseEvent)
        •   NativeRelaySignal* (Basically its DeluxeSignal +
            NativeSignal)

   * Not shown in my demo code.



                                            info@RivelloMultimediaConsulting.com
                                            TM & © 2011 Rivello Multimedia Consulting
AS3-Signals
Other Cool Features


        •   removeAll
        •   addOnce
        •   numListeners
        •   (Event bubbling is coming soon)

   * Thanks to Peter Elst for this information.




                                                  info@RivelloMultimediaConsulting.com
                                                  TM & © 2011 Rivello Multimedia Consulting
SECTION 2
AS3-Signals Applied




                      info@RivelloMultimediaConsulting.com
                      TM & © 2011 Rivello Multimedia Consulting
DEMO
Let's See AS3-Signals in Action!




                            info@RivelloMultimediaConsulting.com
                            TM & © 2011 Rivello Multimedia Consulting
AS3-Signals

 Adding AS3-Signals to Your Project

 Download
       •   Download and unzip https://github.com/robertpenner/as3-signals


 Add SWC to project:
       •   Flash Builder (libs), FDT (libs), Flash CS5 (See 'External Library
           Path')




                                                                                             15
                                                                                             v15
                                                      info@RivelloMultimediaConsulting.com
                                                      TM & © 2011 Rivello Multimedia Consulting
SECTION 3
References & QA




                  info@RivelloMultimediaConsulting.com
                  TM & © 2011 Rivello Multimedia Consulting
Questions / Comments?

Three Sections ~ 30 Minutes
   1.   What is AS3-Signals?
        •   Overview
        •   Implementation
   2.   AS3-Signals Applied
        •   Adding to a new project
        •   Types of Signals
   3.   Conclusion
        •   References
        •   Q&A


                                      info@RivelloMultimediaConsulting.com
                                      TM & © 2011 Rivello Multimedia Consulting
References

Presentation Questions
   Send Questions & Comments

   info@RivelloMultimediaConsulting.com


Consulting Inquiries (RivelloMultimediaConsulting.com)


   Software Architecture, Consulting, Development, & Training.

   info@RivelloMultimediaConsulting.com




                                          info@RivelloMultimediaConsulting.com
                                          TM & © 2011 Rivello Multimedia Consulting

More Related Content

Similar to RMC Intro to AS3-Signals for Flash And Flex

Resume
ResumeResume
Microsoft Outage Analysis
Microsoft Outage AnalysisMicrosoft Outage Analysis
Microsoft Outage Analysis
ThousandEyes
 
Scalar Security Roadshow - Toronto Stop
Scalar Security Roadshow - Toronto StopScalar Security Roadshow - Toronto Stop
Scalar Security Roadshow - Toronto Stop
Scalar Decisions
 
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
Real-Time Innovations (RTI)
 
Sumologic <3 Open Source
Sumologic <3 Open SourceSumologic <3 Open Source
Sumologic <3 Open Source
NGINX, Inc.
 
Voip Eddie Jan2010
Voip Eddie Jan2010Voip Eddie Jan2010
Voip Eddie Jan2010
ekaypour
 
Enabling application portability with the greatest of ease!
Enabling application portability with the greatest of ease!Enabling application portability with the greatest of ease!
Enabling application portability with the greatest of ease!
Ken Owens
 
Piotr Kravtsov - 2016
Piotr Kravtsov - 2016Piotr Kravtsov - 2016
Piotr Kravtsov - 2016
Piotr Kravtsov
 
Scalar Security Roadshow - Ottawa Presentation
Scalar Security Roadshow - Ottawa PresentationScalar Security Roadshow - Ottawa Presentation
Scalar Security Roadshow - Ottawa Presentation
Scalar Decisions
 
Rob Horner resume Jan-6-2016
Rob Horner resume Jan-6-2016Rob Horner resume Jan-6-2016
Rob Horner resume Jan-6-2016
Rob Horner
 
Product Security
Product SecurityProduct Security
Product Security
Steven Carlson
 
Moving from appliances to cloud security with phoenix children's hospital
Moving from appliances to cloud security with phoenix children's hospitalMoving from appliances to cloud security with phoenix children's hospital
Moving from appliances to cloud security with phoenix children's hospital
Zscaler
 
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan MarcilOWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
Jonathan Marcil
 
Secure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous deliverySecure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous delivery
Black Duck by Synopsys
 
Secure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous deliverySecure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous delivery
Tim Mackey
 
PaulDyke_2015b
PaulDyke_2015bPaulDyke_2015b
PaulDyke_2015b
Paul Dyke
 
During the Next Generation Network and Data Centre – Now and into the Future ...
During the Next Generation Network and Data Centre – Now and into the Future ...During the Next Generation Network and Data Centre – Now and into the Future ...
During the Next Generation Network and Data Centre – Now and into the Future ...
Cisco Canada
 
Architectuur 2009
Architectuur 2009Architectuur 2009
Architectuur 2009
boonzaai
 
Tenaro resumedec
Tenaro resumedecTenaro resumedec
Tenaro resumedec
Rochelle Tenaro
 
Curriculum Vitae - Gregory Eales Rev1.52 doc
Curriculum Vitae - Gregory Eales Rev1.52 docCurriculum Vitae - Gregory Eales Rev1.52 doc
Curriculum Vitae - Gregory Eales Rev1.52 doc
Gregory Eales
 

Similar to RMC Intro to AS3-Signals for Flash And Flex (20)

Resume
ResumeResume
Resume
 
Microsoft Outage Analysis
Microsoft Outage AnalysisMicrosoft Outage Analysis
Microsoft Outage Analysis
 
Scalar Security Roadshow - Toronto Stop
Scalar Security Roadshow - Toronto StopScalar Security Roadshow - Toronto Stop
Scalar Security Roadshow - Toronto Stop
 
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
Precise, Predictive, and Connected: DDS and OPC UA – Real-Time Connectivity A...
 
Sumologic <3 Open Source
Sumologic <3 Open SourceSumologic <3 Open Source
Sumologic <3 Open Source
 
Voip Eddie Jan2010
Voip Eddie Jan2010Voip Eddie Jan2010
Voip Eddie Jan2010
 
Enabling application portability with the greatest of ease!
Enabling application portability with the greatest of ease!Enabling application portability with the greatest of ease!
Enabling application portability with the greatest of ease!
 
Piotr Kravtsov - 2016
Piotr Kravtsov - 2016Piotr Kravtsov - 2016
Piotr Kravtsov - 2016
 
Scalar Security Roadshow - Ottawa Presentation
Scalar Security Roadshow - Ottawa PresentationScalar Security Roadshow - Ottawa Presentation
Scalar Security Roadshow - Ottawa Presentation
 
Rob Horner resume Jan-6-2016
Rob Horner resume Jan-6-2016Rob Horner resume Jan-6-2016
Rob Horner resume Jan-6-2016
 
Product Security
Product SecurityProduct Security
Product Security
 
Moving from appliances to cloud security with phoenix children's hospital
Moving from appliances to cloud security with phoenix children's hospitalMoving from appliances to cloud security with phoenix children's hospital
Moving from appliances to cloud security with phoenix children's hospital
 
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan MarcilOWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
 
Secure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous deliverySecure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous delivery
 
Secure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous deliverySecure application deployment in the age of continuous delivery
Secure application deployment in the age of continuous delivery
 
PaulDyke_2015b
PaulDyke_2015bPaulDyke_2015b
PaulDyke_2015b
 
During the Next Generation Network and Data Centre – Now and into the Future ...
During the Next Generation Network and Data Centre – Now and into the Future ...During the Next Generation Network and Data Centre – Now and into the Future ...
During the Next Generation Network and Data Centre – Now and into the Future ...
 
Architectuur 2009
Architectuur 2009Architectuur 2009
Architectuur 2009
 
Tenaro resumedec
Tenaro resumedecTenaro resumedec
Tenaro resumedec
 
Curriculum Vitae - Gregory Eales Rev1.52 doc
Curriculum Vitae - Gregory Eales Rev1.52 docCurriculum Vitae - Gregory Eales Rev1.52 doc
Curriculum Vitae - Gregory Eales Rev1.52 doc
 

Recently uploaded

How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 

Recently uploaded (20)

How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 

RMC Intro to AS3-Signals for Flash And Flex

  • 1. AS3-Signals An Introduction Samuel Asher Rivello Principal, Rivello Multimedia Consulting info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 2. Topic Speaker •Samuel Asher Rivello is the principal of Rivello Multimedia Consulting (RMC). RMC’s Flash and Flex services include software architecture, consulting, development, and training. Sam has a decade of experience creating games and applications, and is currently traveling the globe to collaborate with top companies. Agenda •Learn the benefits and syntax of AS3-Signals Audience •Intermediate to Advanced ActionScript 3.0 Developers Take-Away •Allsource code and documentation will be available to attendees. info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 3. SECTION 1 What is AS3-Signals? info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 4. Agenda Three Sections ~ 30 Minutes 1. What is AS3-Signals? • Overview • Implementation 2. AS3-Signals Applied • Adding to a new project • Types of Signals 3. Conclusion • References • Q&A info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 5. AS3-Signals Overview AS3-Signals is an open-source pure AS3 library created by Robert Penner which facilitates messaging between objects. The 'signals' concept is inspired by C++. AS3-Signals can be used in place of or in addition to flash.events.Event. info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 6. DEMO Let's See Traditional Flash Events In Action! info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 7. Flash Events Drawbacks • Must inherit or compose EventDispatcher • Message types stored as error-prone Strings • Has garbage-collection / clean-up issues • Must subclass flash.events.Event to send custom data.* *Admittedly, with my preferred style of AS3-Signals, I do this too. info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 8. AS3-Signals Benefits • Requires no inheritance • Fast to setup (even with custom data) • Works well with native Flash Events (e.g. MouseEvent) • A powerful addition Robotlegs framework* *An unrelated open-source AS3 framework (Robotlegs.org) info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 9. AS3-Signals Syntax 1 – Pass No Data var signal = new Signal (); signal.add(_onSignalDispatched); //or signal.addOnce(_onSignalDispatched); signal.dispatch(); private function _onSignalDispatched () : void { Trace (“onSignalDispatched: “); } info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 10. AS3-Signals Syntax 2 – Pass Data var signal = new Signal (String, MyCustomClass); signal.add(_onSignalDispatched); //or signal.addOnce(_onSignalDispatched); signal.dispatch(); private function _onSignalDispatched (s : String, c : MyCustomClass) : void { Trace (“onSignalDispatched: “ + s + “ and “ + c); } info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 11. AS3-Signals Types of Signals • Signal – Pass zero or more arguments • DeluxeSignal – Pass GenericEvent (w/ target & Signal) • NativeSignal – Connects a Signal with a Flash Event (e.g. MouseEvent) • NativeRelaySignal* (Basically its DeluxeSignal + NativeSignal) * Not shown in my demo code. info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 12. AS3-Signals Other Cool Features • removeAll • addOnce • numListeners • (Event bubbling is coming soon) * Thanks to Peter Elst for this information. info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 13. SECTION 2 AS3-Signals Applied info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 14. DEMO Let's See AS3-Signals in Action! info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 15. AS3-Signals Adding AS3-Signals to Your Project Download • Download and unzip https://github.com/robertpenner/as3-signals Add SWC to project: • Flash Builder (libs), FDT (libs), Flash CS5 (See 'External Library Path') 15 v15 info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 16. SECTION 3 References & QA info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 17. Questions / Comments? Three Sections ~ 30 Minutes 1. What is AS3-Signals? • Overview • Implementation 2. AS3-Signals Applied • Adding to a new project • Types of Signals 3. Conclusion • References • Q&A info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting
  • 18. References Presentation Questions Send Questions & Comments info@RivelloMultimediaConsulting.com Consulting Inquiries (RivelloMultimediaConsulting.com) Software Architecture, Consulting, Development, & Training. info@RivelloMultimediaConsulting.com info@RivelloMultimediaConsulting.com TM & © 2011 Rivello Multimedia Consulting