ActionScript 3 has access to most aspects of the SWF environment. The first step to understanding how to work with ActionScript 3 is to understand how it relates to the visual environment. SWF applications are composed of timelines (movie clips or sprites) that act as containers for content and code. In ActionScript 3, timelines are display object containers and the visual elements within them are called display objects. The following samples explore timelines, coordinate space, and ActionScript built-in drawing and color controls:
Explore timeline coordinates and the distance and angle between points.
(User level: Beginning)
Explore the effects of timeline nesting and graphic placement within timelines.
(User level: Beginning)
Explore the built-in drawing tools available in sprites and movie clips.
(User level: Intermediate)
Explore color transformations on display objects.
(User level: Intermediate)
Explore the effects of animating two-dimensional objects in 3D space.
(User level: Beginning)
Explore animated patterns created with the Deco tool in 3D space.
(User level: Intermediate)
Explore the transitions available in ActionScript 3.
(User level: Beginning)
Sounds, images, and text can be used to enhance the content in your project. Adobe Flash Player has the ability to use external or embedded media. ActionScript 3 has greater control over media usage and media related events. The following samples highlight how to use text, images, and sound in your project:
Explore a simple paycheck calculator that uses Flash text fields and component text inputs to display dynamic text.
(User level: Intermediate)
Explore a simple image loader and slide show application.
(User level: Beginning)
Explore three types of masking effects used over bitmap images.
(User level: Beginning)
Explore a sample that loads sounds and provides a basic set of custom controls.
(User level: Intermediate)
Explore more in-depth sound controls in this mixing board sample.
(User level: Advanced)
Explore the sound generation capabilities in Flash Player 10 and later.
(User level: Intermediate)
Explore how to use CSS to format a Classic text field using HTML text.
(User level: Intermediate)
Explore how to use CSS to format a TLF text field using both HTML text and TLF markup text.
(User level: Intermediate)
One of the strengths of ActionScript is its ability to create organized, reusable components. Flash Professional CS5 ships with a set of built-in user interface components for ActionScript 2 and ActionScript 3. You can also build your own custom components. The following samples show built-in and custom components in action:
Explore video playback using the ActionScript 3 FLVPlayback component.
(User level: Beginning)
Explore a custom-built ArcadeButton component with author-time Live Preview.
(User level: Intermediate)
Note: To learn more about components, check out the Using ActionScript 3.0 Components documentation for Flash Professional CS5.
There are many occasions when you need to know the viewer's local time and date or the elapsed time in a movie (SWF file). Displaying the date and time in a user interface or the elapsed time during a game or interaction is an easy way to generate interest and a sense of change. The following samples show two approaches for handling time:
Explore an example of a stopwatch-style timer.
(User level: Intermediate)
Explore an example of a clock that displays the computer's local time.
(User level: Beginning)
Flash Professional CS5 is a great tool for building games, learning interactions, and interactive environments. ActionScript 3 expands the options available to developers, allowing for creative solutions to old design problems. You can use the built-in components or build custom controls to create interactive elements in your movie. The following samples create animations through a series of interactive controls:
Explore an interactive screen where an animation is controlled by buttons.
(User level: Intermediate)
Explore an interactive screen where an animation is controlled by sliders.
(User level: Intermediate)
Explore an interactive screen where an animation is controlled by a virtual joystick.
(User level: Intermediate)
Explore an interactive screen where an animation is controlled by keyboard presses.
(User level: Intermediate)
Explore an interactive screen where an animation is controlled by click location.
(User level: Intermediate)
Explore an interactive screen where keyboard controls change the thrust of an animation.
(User level: Intermediate)
Explore an interactive screen where sliders control a dynamically generated sky background.
(User level: Intermediate)
Explore an animation built with the inverse kinematics feature in Flash.
(User level: Intermediate)
The SWF format is a popular medium for online game development due to its history in animation, strength with graphics, and its integrated programming language. The following samples combine previous concepts to form complex game applications:
Explore a maze game where arrow keystrokes control player movement through the boundaries of a maze pattern.
(User level: Intermediate)
Explore a starship game where obstacles and laser fire are dynamically generated through building game levels.
(User level: Advanced)
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.