Technology overview AVM1 and AVM2 AS3 new features AS2 migration to AS3 Coding samples Performance tips The future Questions
Flash Player 2 – timeline control commands Flash Player 3 – load movie Flash Player 4 – Full scripting implementation (Actions, loops, variables, conditions) Flash Player 5- AS1 (prototyped based on ECMA, procedural and OOP) Flash Player 6 – AS1 + Events model, RTMP support, minor language improvements
Flash Player 7 – AS2 introduction (ECMA4), inheritance, CSS support , FP6 support Flash Player 8 – AS1/AS2 improvements, mostly graphical, File uploads Flash Player 9(8.5) – AS3 introduction, AVM2, JIT compilation, Binary sockets, E4X, RegEx Flash Player 10, AIR – the future
Introduced September 2003 – Flash MX 2004 Features Compile time type checking Class based syntax Strict typing Inheritance ECMA 4 partially
Introduced June 2006 – Adobe Flex 2 Features New AVM2 2 AVMs in FP9 player Performance improvement New bytecode compilation Packages support ECMA4 completely
 
Performance Using strict typing Complete rewritten AVM Comparison example Sophistication Complete class support No hacks needed
Evolution of Actionscript 2.0 Full re-engineered for performance Final and Dynamic classes Runtime exception E4X RegEx
Type declaration required (warning) Public, internal, protected, private, final Packages  Constants Int, Uint * vs. Object …  parameter More runtime and compile time errors For each in (E4X)
Completely re-write and organize More object oriented Event Model Display tree exposed Binary Socket Binary Data – Bytes Array More: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/migration.html
Display objects treated as objects Reparenting Handling without display Resource management… Dynamic content, removing idle actions Loaded content (untrusted content) System.totalmemory (process memory info) Weak reference – listeners, Dictionary Garbage collection reference: http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html
Flash CS3  Flex 3 Actionscript project Flex project Flex SDK – open source Flex SDK for player 10 beta
FP9 SWF FP10 SWF Air application Projector application
Http Server side scripts (ASP, PHP), SOAP, REST Images, Progressive download File reference RTMP FMS, Red5 – streaming  Flash remoting
Binary Sockets + binary data TCP, FTP, SMTP etc… External Interface Desktop application wrapper, Javascript Local Connection Communication between movies AVM1 – AVM2 AIR
Say goodbye to: attachAudio, attachBitmap, attachMovie, createEmptyMovieClip, createTextField, duplicateMovieClip, swapDepths, removeMovieClip Say hello to: DisplayObjectContainer, addChild, removeChild
 
DisplayObject – base class, cannot contain additional DisplayObject InteractiveObject – supporting user interaction, such as buttons and text fields DisplayObjectContainer – can contain additional DisplayObject MovieClip – sprite with timeline root =>  stage Examples…
AS2 Callback : onLoad, onData, onPress Events: addListener AS3  Events Model Decoupling Asynchronic execution No more Delegation
Event System Event dispatcher Event listener Event object EventDispatcher class addEventListener dispatchEvent removeEventListener … Example…
Event Propagation Capture At target  Bubbling Example… Event Object Creating custom events  Example…
XML Structure Tree structure of data, built by nodes, properties and values XML Loading URLLoader, URLRequest  XML Example… XML Reading XML Filtering
XML Reading XML – direct data access XMLList – indirect data access (for each in, for) Children() Attributes() Attribute(attName:String) XML Filtering Node values (name == value) Attributes  (@attName == value) Examples…..
Flash Player 10 Communication File system access  Etc. Actionscript 4.0 Array typing Union typing More primitives ECMA 4 compatible (December 2008 spec release) And many more…..

Introduction to Actionscript3

  • 1.
  • 2.
    Technology overview AVM1and AVM2 AS3 new features AS2 migration to AS3 Coding samples Performance tips The future Questions
  • 3.
    Flash Player 2– timeline control commands Flash Player 3 – load movie Flash Player 4 – Full scripting implementation (Actions, loops, variables, conditions) Flash Player 5- AS1 (prototyped based on ECMA, procedural and OOP) Flash Player 6 – AS1 + Events model, RTMP support, minor language improvements
  • 4.
    Flash Player 7– AS2 introduction (ECMA4), inheritance, CSS support , FP6 support Flash Player 8 – AS1/AS2 improvements, mostly graphical, File uploads Flash Player 9(8.5) – AS3 introduction, AVM2, JIT compilation, Binary sockets, E4X, RegEx Flash Player 10, AIR – the future
  • 5.
    Introduced September 2003– Flash MX 2004 Features Compile time type checking Class based syntax Strict typing Inheritance ECMA 4 partially
  • 6.
    Introduced June 2006– Adobe Flex 2 Features New AVM2 2 AVMs in FP9 player Performance improvement New bytecode compilation Packages support ECMA4 completely
  • 7.
  • 8.
    Performance Using stricttyping Complete rewritten AVM Comparison example Sophistication Complete class support No hacks needed
  • 9.
    Evolution of Actionscript2.0 Full re-engineered for performance Final and Dynamic classes Runtime exception E4X RegEx
  • 10.
    Type declaration required(warning) Public, internal, protected, private, final Packages Constants Int, Uint * vs. Object … parameter More runtime and compile time errors For each in (E4X)
  • 11.
    Completely re-write andorganize More object oriented Event Model Display tree exposed Binary Socket Binary Data – Bytes Array More: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/migration.html
  • 12.
    Display objects treatedas objects Reparenting Handling without display Resource management… Dynamic content, removing idle actions Loaded content (untrusted content) System.totalmemory (process memory info) Weak reference – listeners, Dictionary Garbage collection reference: http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html
  • 13.
    Flash CS3 Flex 3 Actionscript project Flex project Flex SDK – open source Flex SDK for player 10 beta
  • 14.
    FP9 SWF FP10SWF Air application Projector application
  • 15.
    Http Server sidescripts (ASP, PHP), SOAP, REST Images, Progressive download File reference RTMP FMS, Red5 – streaming Flash remoting
  • 16.
    Binary Sockets +binary data TCP, FTP, SMTP etc… External Interface Desktop application wrapper, Javascript Local Connection Communication between movies AVM1 – AVM2 AIR
  • 17.
    Say goodbye to:attachAudio, attachBitmap, attachMovie, createEmptyMovieClip, createTextField, duplicateMovieClip, swapDepths, removeMovieClip Say hello to: DisplayObjectContainer, addChild, removeChild
  • 18.
  • 19.
    DisplayObject – baseclass, cannot contain additional DisplayObject InteractiveObject – supporting user interaction, such as buttons and text fields DisplayObjectContainer – can contain additional DisplayObject MovieClip – sprite with timeline root => stage Examples…
  • 20.
    AS2 Callback :onLoad, onData, onPress Events: addListener AS3 Events Model Decoupling Asynchronic execution No more Delegation
  • 21.
    Event System Eventdispatcher Event listener Event object EventDispatcher class addEventListener dispatchEvent removeEventListener … Example…
  • 22.
    Event Propagation CaptureAt target Bubbling Example… Event Object Creating custom events Example…
  • 23.
    XML Structure Treestructure of data, built by nodes, properties and values XML Loading URLLoader, URLRequest XML Example… XML Reading XML Filtering
  • 24.
    XML Reading XML– direct data access XMLList – indirect data access (for each in, for) Children() Attributes() Attribute(attName:String) XML Filtering Node values (name == value) Attributes (@attName == value) Examples…..
  • 25.
    Flash Player 10Communication File system access Etc. Actionscript 4.0 Array typing Union typing More primitives ECMA 4 compatible (December 2008 spec release) And many more…..