About ActionScript - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

About ActionScript

Description:

'Only the wisest and stupidest of men never change.' Confucius ' ... Multiple versions of ActionScript can lead to user confusion ... – PowerPoint PPT presentation

Number of Views:75
Avg rating:3.0/5.0
Slides: 11
Provided by: gawainSoc
Category:

less

Transcript and Presenter's Notes

Title: About ActionScript


1
About ActionScript
  • Only the wisest and stupidest of men never
    change. Confucius
  • We cannot become what we need to be by remaining
    what we are. Max Depree
  • Multiple versions of ActionScript can lead to
    user confusion
  • Older books and tutorials may still be useful

2
Summary of Differences
  • Flash 5 and the new Flash MX 2004 are very
    different
  • MX 2004s ActionScript 2.0 is a standard form of
    JavaScript (actually ECMAscript)
  • Built-in components are different
  • Testing and debugging capabilities improved
  • Much easier to support mobile platforms with MX
    2004

3
Why the interest in scripting?
  • Enables us to import and export information
  • Possible to create interactive, smart forms
  • And to build network communications programs e.g.
    instant messaging apps
  • We can personalise the users experience
  • And control movie clips and their properties more
    tightly

4
Why the interest in scripting?
  • Script-based animation of elements in your movie,
    without using the timeline see tutorial
  • Build dynamic projects that vary according to
    external information, e.g. weather data or the
    day of the week
  • Dynamically control sound volume and stereo
    panning
  • Monitor user interaction, mouse and keyboard

5
ActionScript
  • ActionScript 1.0
  • Good for simple interactivity
  • Basic glue coding
  • Plenty of code available (often quite rough)
  • Limited capabilities leads to some kludge coding
  • Non-standard language, related to JavaScript
  • Can be very slow in Flash 5
  • Even sloppy code runs

6
ActionScript
  • ActionScript 2.0
  • A proper object oriented programming language!
  • Good for more complex code
  • Deeper control of Flash capabilities
  • More flexible programming environment
  • Superior debugging capabilities
  • Cleaner coding, more readable
  • Stricter syntax and error checking

7
Good News
  • You can still program using ActionScript 1.0 in
    Flash MX 2004
  • Performance of AS1 is good in MX 2004
  • ActionScript 2.0 code strongly resembles Java
  • So ActionScript 2.0 knowledge can easily be
    re-used in the industrial-strength,
    cross-platform world of Java

8
More Good News
  • AS2.0 code runs about five times faster than
    original Flash 5 AS1.0 code!
  • This opens up possibilities that were closed
    before, like interactive games with complex
    processing (e.g. game AI)

9
Tricks and Traps
  • AS2.0 is case sensitive nCounter ! ncounter !
    NCounter
  • Note that old code may fail stopAllSounds() //
    works! stopallsounds() // fails!
  • AS2.0 has strict data typing var nCounterNumber
    36Variable nCounter, of type Number, set to
    36
  • Strict data typing improves run-time performance

10
References
  • ActionScript 2.0 A Real Programming
    Languagehttp//www.peachpit.com/articles/article.
    asp?p102204
  • Introducing ActionScripthttp//www.macromedia.com
    /devnet/mx/flash/articles/astfts_excerpt/astfts_le
    sson1.pdf
  • Kirupa ActionScript 2.0 OOPhttp//www.kirupa.com/
    developer/oop2/AS2OOPindex.htm
Write a Comment
User Comments (0)
About PowerShow.com