SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Creative Programming in ActionScript 3.0
•   Flash Platform Consultant
•   Lecturer Devine
•   Adobe Community Expert
•   Technical author
•   Full time web geek
Creativity is a mental process involving
the generation of new ideas or concepts,
or new associations of the creative mind
  between existing ideas or concepts.
Programming is a the process of writing,
 testing, debugging and maintaining the
  source code of computer programs.
What will we talk about?
•   Object-Oriented Programming
    • Classes and instances
    • Inheritance
    • Encapsulation
•   Basic trigonometry
    • Distance between points
    • Polar and Cartesian coordinates
•   Experimentation
    • BitmapData
    • Sound Spectrum
Object-Oriented Programming
Classes and instances
Classes
•   Classes are blueprints of functionality
•   Allow for reusable and modular code
•   Contain methods (functions) and properties (variables)




                 Ball class
Instances
•   Instances (objects) are copies based on a class blueprint
•   Instance property values are independent of its class




                              Ball class




Ball instance         Ball instance           Ball instance
Example (Library panel)
HelloWorld.as

package {

    public class HelloWorld {

        public var name:String;

        public function HelloWorld(value:String) {
          this.name = value;
          trace(“Hello world from “+ this.name);
        }

    }

}
HelloWorld instances

var myWorld:HelloWorld = new HelloWorld(“Peter”);
// Hello world from Peter
trace(myWorld.name); // Peter


var otherWorld:HelloWorld = new HelloWorld(“Barack”);
// Hello world from Barack
trace(myWorld.name); // Barack
Inheritance
•   Classes can extend each others functionality
•   Each class can only inherit from one super class
•   Use the “extends” keyword


                  Animal class

       Dog class                     Cat class

                                    Tiger class
Example (inheritance.fla)
Encapsulation
•   Protect the inner workings of your class
•   Access modifiers (public, private, protected, internal)
•   Use getter/setter methods to provide access




         getter/setter
                                     other class
         class
       internals
Access modifiers
•   public - accessible from anywhere
•   private - only accessible from within the class
•   protected - only accessible within class and subclasses
•   internal - only accessible within same package (default)
Getter/setters
•   Looks like a method, behaves like a property
•   Provides a single entry point for setting a property
•   Useful for input validation

    private var _age:Number;

    public function get age():Number {
      return this._age;
    }

    public function set age(val:Number):void {
      if(val >= 18) {
        this._age = val;
      } else {
        trace(“you are too young”);
      }
    }
Account.as
package {
  public class Account {
    private var _email:String;

        public function set email(val:String):void {
          if(val.indexOf(“@”) != -1) {
            this._email = val;
          } else {
            trace(“invalid email”);
          }
        }

    }
}

var myAccount:Account = new Account();
myAccount.email = “peter.elst@gmail.com”;
Basic Trigonometry
Distance between points

                point 2




 point 1
Distance between points

                   point 2


           C
                       B


 point 1
               A
A² + B² = C²
√
d(P1,
P2)
=



(x2
‐
x1)2
+
(y 
–
y )
2
                              2    1
Example (distance.fla)
Cartesian coordinates

                 (x,y)




                         x




           y
Polar coordinates

               (r, θ)

           r

           θ
A² + B² = C²

                (r, θ)

        C
                B
        θ

            A
Converting polar coordinates

     x
=
Math.cos(θ)
*
radius
     y
=
Math.sin(θ)
*
radius


    θ
is
the
angle
in
radians
Example (polar-animation.fla)
Experimentation
flash.display.BitmapData

 •   Allows you to get pixel level access to bitmaps
 •   Work with color channels
 •   Perform bitmap operations
SoundMixer.computeSpectrum

•   Returns spectrum information of sound
•   ByteArray with floating point values between -1 and 1
•   Raw wave form or Fast Fourier Transform (FFT)
•   Doesn’t work for microphone input (yet) :(
    • see www.getmicrophone.com
Books
Foundation ActionScript 3.0 Animation “Making Things Move”
Object-Oriented ActionScript 3.0

Websites
www.gotoandlearn.com
www.levitated.net



Get in touch
Email: peter.elst@gmail.com
Blog: www.peterelst.com
Twitter: peterelst




                                                             Thank you!

Más contenido relacionado

La actualidad más candente

ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2zukun
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritanceshatha00
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)Eduard Tomàs
 
Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)farhan amjad
 
Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in ScalaDamian Jureczko
 
Authorship attribution pydata london
Authorship attribution   pydata londonAuthorship attribution   pydata london
Authorship attribution pydata londonkperi
 
Propof identequal.ppt
Propof identequal.pptPropof identequal.ppt
Propof identequal.pptaikes88
 

La actualidad más candente (9)

ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritance
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)
 
Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
 
Authorship attribution pydata london
Authorship attribution   pydata londonAuthorship attribution   pydata london
Authorship attribution pydata london
 
Ch2 Liang
Ch2 LiangCh2 Liang
Ch2 Liang
 
Propof identequal.ppt
Propof identequal.pptPropof identequal.ppt
Propof identequal.ppt
 

Destacado

Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) TutorialPEI-YAO HUNG
 
Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0Peter Elst
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptChristophe Herreman
 
Giáo trình học Html5/Css3
Giáo trình học Html5/Css3Giáo trình học Html5/Css3
Giáo trình học Html5/Css3Ho Ngoc Tan
 
Presentacion dreamweaver html
Presentacion dreamweaver htmlPresentacion dreamweaver html
Presentacion dreamweaver htmledinson
 
Cariño Especial
Cariño EspecialCariño Especial
Cariño Especialedinson
 
Essential action script 3.0
Essential action script 3.0Essential action script 3.0
Essential action script 3.0UltimateCodeX
 
Giáo trình Flash CS5 và Action Script 3.0
Giáo trình Flash CS5 và Action Script 3.0Giáo trình Flash CS5 và Action Script 3.0
Giáo trình Flash CS5 và Action Script 3.0Kenny Nguyen
 
Action script for designers
Action script for designersAction script for designers
Action script for designersoyunbaga
 
Actionscript
ActionscriptActionscript
Actionscriptedinson
 
ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsSaurabh Narula
 
Actionscript
ActionscriptActionscript
Actionscriptsaysam
 
Historia de flas h, actionscript,director
Historia de flas h, actionscript,directorHistoria de flas h, actionscript,director
Historia de flas h, actionscript,directordiana-16ramos
 
Actionscript
ActionscriptActionscript
Actionscriptyyurany
 
Kernel vm#9 powerkvm-dist-20131208
Kernel vm#9 powerkvm-dist-20131208Kernel vm#9 powerkvm-dist-20131208
Kernel vm#9 powerkvm-dist-20131208Manabu Ori
 
Giáo trình đọc hiểu bản vẽ cơ khí
Giáo trình đọc hiểu bản vẽ cơ khíGiáo trình đọc hiểu bản vẽ cơ khí
Giáo trình đọc hiểu bản vẽ cơ khíTrung tâm Advance Cad
 
Giáo trình học tiếng anh Student book 1
Giáo trình học tiếng anh Student book 1Giáo trình học tiếng anh Student book 1
Giáo trình học tiếng anh Student book 1Keziah Huong
 
Giáo trình giảng dạy Autocad 2016 cơ bản
Giáo trình giảng dạy Autocad 2016 cơ bảnGiáo trình giảng dạy Autocad 2016 cơ bản
Giáo trình giảng dạy Autocad 2016 cơ bảnTrung tâm Advance Cad
 
Giáo trình Robot Structural 2016 Tập 2
Giáo trình Robot Structural 2016 Tập 2Giáo trình Robot Structural 2016 Tập 2
Giáo trình Robot Structural 2016 Tập 2Huytraining
 
AppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes
 

Destacado (20)

Coding Flash : ActionScript(3.0) Tutorial
Coding Flash :  ActionScript(3.0) TutorialCoding Flash :  ActionScript(3.0) Tutorial
Coding Flash : ActionScript(3.0) Tutorial
 
Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0Object-Oriented ActionScript 3.0
Object-Oriented ActionScript 3.0
 
How to build an AOP framework in ActionScript
How to build an AOP framework in ActionScriptHow to build an AOP framework in ActionScript
How to build an AOP framework in ActionScript
 
Giáo trình học Html5/Css3
Giáo trình học Html5/Css3Giáo trình học Html5/Css3
Giáo trình học Html5/Css3
 
Presentacion dreamweaver html
Presentacion dreamweaver htmlPresentacion dreamweaver html
Presentacion dreamweaver html
 
Cariño Especial
Cariño EspecialCariño Especial
Cariño Especial
 
Essential action script 3.0
Essential action script 3.0Essential action script 3.0
Essential action script 3.0
 
Giáo trình Flash CS5 và Action Script 3.0
Giáo trình Flash CS5 và Action Script 3.0Giáo trình Flash CS5 và Action Script 3.0
Giáo trình Flash CS5 và Action Script 3.0
 
Action script for designers
Action script for designersAction script for designers
Action script for designers
 
Actionscript
ActionscriptActionscript
Actionscript
 
ActionScript 3.0 Fundamentals
ActionScript 3.0 FundamentalsActionScript 3.0 Fundamentals
ActionScript 3.0 Fundamentals
 
Actionscript
ActionscriptActionscript
Actionscript
 
Historia de flas h, actionscript,director
Historia de flas h, actionscript,directorHistoria de flas h, actionscript,director
Historia de flas h, actionscript,director
 
Actionscript
ActionscriptActionscript
Actionscript
 
Kernel vm#9 powerkvm-dist-20131208
Kernel vm#9 powerkvm-dist-20131208Kernel vm#9 powerkvm-dist-20131208
Kernel vm#9 powerkvm-dist-20131208
 
Giáo trình đọc hiểu bản vẽ cơ khí
Giáo trình đọc hiểu bản vẽ cơ khíGiáo trình đọc hiểu bản vẽ cơ khí
Giáo trình đọc hiểu bản vẽ cơ khí
 
Giáo trình học tiếng anh Student book 1
Giáo trình học tiếng anh Student book 1Giáo trình học tiếng anh Student book 1
Giáo trình học tiếng anh Student book 1
 
Giáo trình giảng dạy Autocad 2016 cơ bản
Giáo trình giảng dạy Autocad 2016 cơ bảnGiáo trình giảng dạy Autocad 2016 cơ bản
Giáo trình giảng dạy Autocad 2016 cơ bản
 
Giáo trình Robot Structural 2016 Tập 2
Giáo trình Robot Structural 2016 Tập 2Giáo trình Robot Structural 2016 Tập 2
Giáo trình Robot Structural 2016 Tập 2
 
AppCodes - app store marketing toolbox
AppCodes - app store marketing toolboxAppCodes - app store marketing toolbox
AppCodes - app store marketing toolbox
 

Similar a Creative Programming in ActionScript 3.0

JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)jeresig
 
Tamarin And Ecmascript 4
Tamarin And Ecmascript 4Tamarin And Ecmascript 4
Tamarin And Ecmascript 4elliando dias
 
Rapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and RailsRapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and Railselliando dias
 
javascript teach
javascript teachjavascript teach
javascript teachguest3732fa
 
JSBootcamp_White
JSBootcamp_WhiteJSBootcamp_White
JSBootcamp_Whiteguest3732fa
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?Christophe Porteneuve
 
Tamarin and ECMAScript 4
Tamarin and ECMAScript 4Tamarin and ECMAScript 4
Tamarin and ECMAScript 4jeresig
 
Groovy and Grails talk
Groovy and Grails talkGroovy and Grails talk
Groovy and Grails talkdesistartups
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpMichael Girouard
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptCaridy Patino
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)Chhom Karath
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusRaimundas Banevičius
 
No JS and DartCon
No JS and DartConNo JS and DartCon
No JS and DartConanandvns
 
JavaScript 2016 for C# Developers
JavaScript 2016 for C# DevelopersJavaScript 2016 for C# Developers
JavaScript 2016 for C# DevelopersRick Beerendonk
 
Implementation of interface9 cm604.30
Implementation of interface9 cm604.30Implementation of interface9 cm604.30
Implementation of interface9 cm604.30myrajendra
 
Metaprogramming Techniques In Groovy And Grails
Metaprogramming Techniques In Groovy And GrailsMetaprogramming Techniques In Groovy And Grails
Metaprogramming Techniques In Groovy And GrailszenMonkey
 

Similar a Creative Programming in ActionScript 3.0 (20)

JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)
 
Tamarin And Ecmascript 4
Tamarin And Ecmascript 4Tamarin And Ecmascript 4
Tamarin And Ecmascript 4
 
Rapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and RailsRapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and Rails
 
javascript teach
javascript teachjavascript teach
javascript teach
 
JSBootcamp_White
JSBootcamp_WhiteJSBootcamp_White
JSBootcamp_White
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?
 
Tamarin and ECMAScript 4
Tamarin and ECMAScript 4Tamarin and ECMAScript 4
Tamarin and ECMAScript 4
 
Dart
DartDart
Dart
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
Groovy and Grails talk
Groovy and Grails talkGroovy and Grails talk
Groovy and Grails talk
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented Php
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas banevicius
 
No JS and DartCon
No JS and DartConNo JS and DartCon
No JS and DartCon
 
JavaScript 2016 for C# Developers
JavaScript 2016 for C# DevelopersJavaScript 2016 for C# Developers
JavaScript 2016 for C# Developers
 
Implementation of interface9 cm604.30
Implementation of interface9 cm604.30Implementation of interface9 cm604.30
Implementation of interface9 cm604.30
 
Metaprogramming Techniques In Groovy And Grails
Metaprogramming Techniques In Groovy And GrailsMetaprogramming Techniques In Groovy And Grails
Metaprogramming Techniques In Groovy And Grails
 

Más de Peter Elst

P2P on the local network
P2P on the local networkP2P on the local network
P2P on the local networkPeter Elst
 
P2P with Flash Player 10.1
P2P with Flash Player 10.1P2P with Flash Player 10.1
P2P with Flash Player 10.1Peter Elst
 
Big boys and their litl toys
Big boys and their litl toysBig boys and their litl toys
Big boys and their litl toysPeter Elst
 
Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0Peter Elst
 
FATC - AIR 2.0 workshop
FATC - AIR 2.0 workshopFATC - AIR 2.0 workshop
FATC - AIR 2.0 workshopPeter Elst
 
Developing with Adobe AIR
Developing with Adobe AIRDeveloping with Adobe AIR
Developing with Adobe AIRPeter Elst
 
Introduction to AS3Signals
Introduction to AS3SignalsIntroduction to AS3Signals
Introduction to AS3SignalsPeter Elst
 
The Secret Life of a Flash Freelancer
The Secret Life of a Flash FreelancerThe Secret Life of a Flash Freelancer
The Secret Life of a Flash FreelancerPeter Elst
 
Getting Creative with Adobe AIR
Getting Creative with Adobe AIRGetting Creative with Adobe AIR
Getting Creative with Adobe AIRPeter Elst
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRPeter Elst
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Peter Elst
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets DesktopPeter Elst
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash PlatformPeter Elst
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIRPeter Elst
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRPeter Elst
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets DesktopPeter Elst
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0Peter Elst
 

Más de Peter Elst (17)

P2P on the local network
P2P on the local networkP2P on the local network
P2P on the local network
 
P2P with Flash Player 10.1
P2P with Flash Player 10.1P2P with Flash Player 10.1
P2P with Flash Player 10.1
 
Big boys and their litl toys
Big boys and their litl toysBig boys and their litl toys
Big boys and their litl toys
 
Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0Yes, you can do that with AIR 2.0
Yes, you can do that with AIR 2.0
 
FATC - AIR 2.0 workshop
FATC - AIR 2.0 workshopFATC - AIR 2.0 workshop
FATC - AIR 2.0 workshop
 
Developing with Adobe AIR
Developing with Adobe AIRDeveloping with Adobe AIR
Developing with Adobe AIR
 
Introduction to AS3Signals
Introduction to AS3SignalsIntroduction to AS3Signals
Introduction to AS3Signals
 
The Secret Life of a Flash Freelancer
The Secret Life of a Flash FreelancerThe Secret Life of a Flash Freelancer
The Secret Life of a Flash Freelancer
 
Getting Creative with Adobe AIR
Getting Creative with Adobe AIRGetting Creative with Adobe AIR
Getting Creative with Adobe AIR
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets Desktop
 
The Evolution of the Flash Platform
The Evolution of the Flash PlatformThe Evolution of the Flash Platform
The Evolution of the Flash Platform
 
SQLite in Adobe AIR
SQLite in Adobe AIRSQLite in Adobe AIR
SQLite in Adobe AIR
 
Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
RIA meets Desktop
RIA meets DesktopRIA meets Desktop
RIA meets Desktop
 
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
SkillsMatter - In-the-Brain session - What's new in ActionScript 3.0
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 WorkerThousandEyes
 
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...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
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...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Creative Programming in ActionScript 3.0

  • 1. Creative Programming in ActionScript 3.0
  • 2. Flash Platform Consultant • Lecturer Devine • Adobe Community Expert • Technical author • Full time web geek
  • 3. Creativity is a mental process involving the generation of new ideas or concepts, or new associations of the creative mind between existing ideas or concepts.
  • 4. Programming is a the process of writing, testing, debugging and maintaining the source code of computer programs.
  • 5. What will we talk about? • Object-Oriented Programming • Classes and instances • Inheritance • Encapsulation • Basic trigonometry • Distance between points • Polar and Cartesian coordinates • Experimentation • BitmapData • Sound Spectrum
  • 8. Classes • Classes are blueprints of functionality • Allow for reusable and modular code • Contain methods (functions) and properties (variables) Ball class
  • 9. Instances • Instances (objects) are copies based on a class blueprint • Instance property values are independent of its class Ball class Ball instance Ball instance Ball instance
  • 11. HelloWorld.as package { public class HelloWorld { public var name:String; public function HelloWorld(value:String) { this.name = value; trace(“Hello world from “+ this.name); } } }
  • 12. HelloWorld instances var myWorld:HelloWorld = new HelloWorld(“Peter”); // Hello world from Peter trace(myWorld.name); // Peter var otherWorld:HelloWorld = new HelloWorld(“Barack”); // Hello world from Barack trace(myWorld.name); // Barack
  • 13. Inheritance • Classes can extend each others functionality • Each class can only inherit from one super class • Use the “extends” keyword Animal class Dog class Cat class Tiger class
  • 15. Encapsulation • Protect the inner workings of your class • Access modifiers (public, private, protected, internal) • Use getter/setter methods to provide access getter/setter other class class internals
  • 16. Access modifiers • public - accessible from anywhere • private - only accessible from within the class • protected - only accessible within class and subclasses • internal - only accessible within same package (default)
  • 17. Getter/setters • Looks like a method, behaves like a property • Provides a single entry point for setting a property • Useful for input validation private var _age:Number; public function get age():Number { return this._age; } public function set age(val:Number):void { if(val >= 18) { this._age = val; } else { trace(“you are too young”); } }
  • 18. Account.as package { public class Account { private var _email:String; public function set email(val:String):void { if(val.indexOf(“@”) != -1) { this._email = val; } else { trace(“invalid email”); } } } } var myAccount:Account = new Account(); myAccount.email = “peter.elst@gmail.com”;
  • 20. Distance between points point 2 point 1
  • 21. Distance between points point 2 C B point 1 A
  • 22. A² + B² = C²
  • 26. Polar coordinates (r, θ) r θ
  • 27. A² + B² = C² (r, θ) C B θ A
  • 28. Converting polar coordinates x
=
Math.cos(θ)
*
radius y
=
Math.sin(θ)
*
radius θ
is
the
angle
in
radians
  • 31. flash.display.BitmapData • Allows you to get pixel level access to bitmaps • Work with color channels • Perform bitmap operations
  • 32. SoundMixer.computeSpectrum • Returns spectrum information of sound • ByteArray with floating point values between -1 and 1 • Raw wave form or Fast Fourier Transform (FFT) • Doesn’t work for microphone input (yet) :( • see www.getmicrophone.com
  • 33. Books Foundation ActionScript 3.0 Animation “Making Things Move” Object-Oriented ActionScript 3.0 Websites www.gotoandlearn.com www.levitated.net Get in touch Email: peter.elst@gmail.com Blog: www.peterelst.com Twitter: peterelst Thank you!