SlideShare a Scribd company logo
1 of 33
Download to read offline
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!

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

More from 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
 

More from 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
 

Recently uploaded

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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)
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

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!