moock.org |
essential actionscript 3.0 |
essential actionscript 3.0 examples
Following are the major examples in the book Essential ActionScript 3.0, by Colin Moock. Note that example and page numbers listed below are based on the book's first printing, and may not match later printings. Examples marked "(bonus)" are offered as additional study material, and are not found in the book.
To use any example project in Flex Builder:To use an example project in Flash CS3:
- Select File > Import > Existing projects into workspace.
- Select the root directory for the project you wish to import.
Note that projects that load external files (.swf, .gif, .xml) are compiled for network use and will cause a security error when tested locally outside of a trusted folder. Importing a project into Flex Builder 2 automatically grants trust to that project's main directory. To grant trust to a folder without importing it into Flex Builder, follow these steps:
- Make a new .fla file in the example's /src/ folder.
- Open the .fla file in Flash CS3.
- In the Properties panel, for Document class, specify the name of the example's main class, without any file extension (e.g., VirtualZoo, not VirtualZoo.as).
- Compile the example via either File > Publish, or Control > Test Movie.
For more information on Flash Player security limitations, see Chapter 19 of Essential ActionScript 3.0.
- Open the online Flash Player Settings Manager by browsing to the following web page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
- Under Global Security Settings>Always trust files in these locations, click Edit locations>Add location....
- Enter or browse to the location you wish to trust.
Download All Examples Virtual Zoo ProgramChapter 9
- Virtual Zoo, Chapter 7 Version, Flex Builder 2
- Virtual Zoo, Chapter 13 Version, Flex Builder 2
- Virtual Zoo, Final Version, Flex Builder 2
- Virtual Zoo, Chapter 7 Version, Flash CS3
- Virtual Zoo, Chapter 7 Version, mxmlc
Chapter 12
- fig. 9.2, Serializer
Chapter 14
- p. 225, Custom "toggle" Event
- p. 238 (bonus), Shared Events (Main)
- p. 238 (bonus),Shared Events (Module)
- ex. 12-3, Target vs CurrentTarget (HighlightText)
- ex. 12-4, Custom "gameover" Event
- ex. 12-5, Custom Cancelable Event (ControlPanel)
Chapter 17
- ex. 14-1, Garbage Collection Demo
Chapter 18
- ex. 17-3, Kids Game
- ex. 17-5, 17-6, Permission-based Access Control
- ex. 17-7, Program Modes (Japanese/English Dictionary)
Chapter 20
- ex. 18-13, XML Loading Demo
Chapter 21
- ex. 20-1, The GreetingApp Class
- ex. 20-2, The WordHighlighter Class
- ex. 20-8, Custom ADDED_TO_STAGE/REMOVED_FROM_STAGE Events
Chapter 22
- ex. 21-2, Checkbox Demo
- ex. 21-3, Tool Panel Demo
- ex. 21-6 through 21-8, Shopping Basket Demo
Chapter 23
- p. 546, Global Mouse Motion Sensor
- p. 547, Circle Clicker
- ex. 22-5, Custom Mouse Pointer
- ex. 22-7, Global Focus Sensor
- ex. 22-8, Object Focus Sensor
- ex. 22-9, Global Keyboard Sensor
- ex. 22-10, Object Keyboard Sensor
- ex. 22-11Key Viewer
- ex. 22-13, Text Input (UppercaseConverter)
- ex. 22-14, Change Demo (PhotoPanel)
- ex. 22-15, Scroll Demo (ScrollBar)
- ex. 22-17, Link Demo (ChatRoom)
- ex. 22-18, Activate Demo (Spinner)
- ex. 22-19, Resize Demo (StretchyLayout)
Chapter 24
- ex. 23-1, Framerate Meter
- ex. 23-5, Render Event Demo (Ellipse)
Chapter 25
- ex. 24-3, 24-5, p. 615, TextTo300 Animation
- ex. 24-7, Animation Library
- ex. 24-8, 24-9, Animation Library Demo
- ex. 24-10, Velocity-based Animation
Chapter 26
- ex. 25-1 through 25-5, Drawing Library
- ex. 25-6, Drawing Library Demo
Chapter 27
- ex. 26-1, Pixel Class
- ex. 26-2, Bitmap Loading Example (BitmapLoader)
- ex. 26-4, Color Picker
- ex. 26-6, ScribbleAS3, Bitmap Dot-drawing Version
- ex. 26-9, Dissolve Text
- ex. 26-10, ScribbleAS3, Buffered Vector-drawing Version
- ex. 26-11, 26-12, Scrap Book Effect
- (bonus) Grayscale Effect
- (bonus) Palette Map Demo
- (bonus) ScribbleAS3, Bitmap Line-drawing Version
- (bonus) ScribbleAS3, Vector-drawing Version
- (bonus) Tile Map Library
Chapter 28
- ex. 27-10StyleSheet Loading Demo
- ex. 27-14, Font Embedding Demo
- ex. 27-19, Font Fallback Demo
Chapter 29
- p. 808-813, Embed a Display Asset (Class level)
- ex. 28-8, Sunset Viewer
- ex. 28-9, Application Domain Main
- ex. 28-9, Application Domain Module
- ex. 28-10, Accessing Assets in a Multiframe Loaded .swf File (Polling Version)
- ex. 28-11, Accessing Assets in a Multiframe Loaded .swf File (Event Version)
- ex. 28-12, 28-13, Load Asset Over Socket
- ex. 28-14, Embed XML
- ex. 28-15, Embed a Display Asset (Variable level)
Chapter 30
- p. 829, Flash CS3 Document Class
- p. 843, A .fla with MovieClip Subclass Instances on Stage
- p. 849 (bonus), Linking a Symbol to a Class (LoginForm)
- p. 849-851, Linking Many Symbols to a Class (LoginForm)
- p. 851-852, Symbol Linkage Alternative Example (LoginManager)
- p. 852-855, A .fla with a Class Preloader
Chapter 31
- p. 856-860, Minimal MXML
ActionScript 3.0 Versions of Essential ActionScript 2.0 Examples
- The beavercore Class Library
- The beavercore Class Library (Flash CS3 Version)
- Barky's Pet Supplies
- Barky's Pet Supplies (Flash CS3 Version)
- Mega Bridal Depot
- Mega Bridal Depot (Flash CS3 Version)
- (bonus) ImageViewer
- (bonus) ImageViewer Demos
- (bonus) Logger
- (bonus) Logger Demo
- (bonus) Observable/Observer