SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à RMC Intro to AS3-Signals for Flash And Flex

Voip Eddie Jan2010
Voip Eddie Jan2010Voip Eddie Jan2010
Voip Eddie Jan2010
ekaypour
 
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
 
PaulDyke_2015b
PaulDyke_2015bPaulDyke_2015b
PaulDyke_2015b
Paul Dyke
 
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
 

Similaire à 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
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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