Introduction To: Actionscript 3.0 Programming
Introduction To: Actionscript 3.0 Programming
Thomas Lvgren
Flash developer, designer & programmer
[email protected]
Lecture outline
In this lecture well discuss the following topics:
Programming introduction:
Introduction
Workspace
Coding tips
Optimizing
Publishing
Links & Resources
Introduction
Machinarium: The best selling iPad app on the App Store was
created with Adobe Flash (Aug/Sept 2011)
Introduction
Adobe AIR: A powerful and flexible technique for building web, mobile, desktop (standalone)
& TV-applications (ActionScript 3)
Adobe Flex: Open source framework that allows you to build applications for mobile-devices,
browsers and desktops (ActionScript 3)
Adobe Flash Builder: Development tool for building expressive mobile, web, and desktop
applications using the Flex framework (ActionScript 3)
FlashDevelop: is a free and open source (MIT license) source code editor (ActionScript 3)
Adobe Flash Catalyst: Interaction design software, integrate content with Flex and write code
in Flash Builder (ActionScript 3)
Note! Some of these techniques & tools also supports HTML, HTML5, JavaScript, CSS besides AS3
Introduction
ActionScript versions
ActionScript 2.0 (Flash 7 MX 2004)
Objectoriented, classes, objects, inheritance, components etc
Based on ECMAScript
9
1. Main Menu 7. Align/Info/Transform/History 13. Frames/tween
2. Tool panel 8. Color/swatches 14. Object on stage
3. ActionScript Editor/Panel 9. Components 15. Code Snippets
4. Timeline (main) 10. Library 16. Errors & Output
5. Properties & Publishing settings 11. Main stage 17. Help (Tip: use this!)
6. Main toolbar 12. Document Properties
Export movie: Ctrl + Enter Colors and Workspace layout can be saved!
Introduction
3
1 5
2
8
Example
Think of a blueprint for a House
If the blueprint is the Class, then the House is the Object
From the House Class, we can create as many House Objects we want (with unique
properties)
Properties are parameters that describes the Object
Every new House Object is a new Instance of the House Class
Introduction
Comments
Line comments and Block comments
Make the code more understandable
Tip: use comments!
Variables & Data-types
Trace - command
A testing and debugging command for quick feedback
Places any relevant text into the Flash Output panel
Only available at author-time, and has no use at runtime
For example, the trace command could be useful for testing: a loop, function, or a loading
process
Introduction
Pseudocode (algoritms)
Pseudo-code (algorithms) are very useful when you are dealing with all kids of programming (
breaking down, structure & solving problems)
Syntax structure
Its highly recommended to use a good programming/syntax structure (that feels
comfortable)
The program reads/executes the code from top to bottom
Flash Player
Adobe Flash Player, is a free software application (browser plug-in) which allows the
playing of standalone Adobe Flash (SWF) content
The Flash Player API is the set of classes, objects, functions, and properties that come built
into Flash Player
There are several key-benefits in terms of: Reach, consistency, and expressiveness
Positive: Over 99% of all internet-enabled computers have Flash Player today
Negative: Its a plug-in that has to be installed
http://www.adobe.com/products/player_census/flashplayer/version_penetration.html
Introduction
Accessibility
http://www.adobe.com/accessibility/products/flash/ Help &Support
Flash Help file: Local on computer (if installed)
Adobe Flash Player Flash/ActionScript Websites & Forums
http://www.adobe.com/products/flashplayer/ Download and study exemples
Blogs
Internet (googling)