Bridging the Gap: Writing Custom AS3 Classes
For many Flash developers and designers the main obstacle in switching to ActionScript 3 is writing and using AS3 custom classes. Timeline scripting is perfectly fine with AS3. In fact, in many tutorials on our website we use timeline scripting; in some we use custom AS3 classes. However, most of the resources and materials on AS3 employ the class-based approach and it is hard to use those materials without basic familiarity with AS3 classes. Also, to take full advantage of AS3 true power, one needs to use its object-oriented structure. This means moving away from timeline scripting, at least partially, and writing code that resides in external class files. In this section of our website, we hope to provide a gentle, example-based introduction to writing and using AS3 custom classes. (The tutorials provide a systematic exposition if you read them from the bottom up.)
-
NEW!
Bubbling Liquid, MovieClips Linked to Custom AS3 Classes
The tutorial illustrates various ways
of controlling at runtime MovieClips created at design time. We start by placing
code on a MovieClip's timeline and end by linking MovieClips to custom
AS3 classes. We use bubbling liquid and the Cereal Box Problem as examples.
-
Cube in Bloom: Distorting Images in ActionScript 3
We construct a vibrant gallery of flowers on a cube. We provide custom AS3 classes: BitmapTransformer,
CubeMenu, and ImageLoader. These classes make it easy to customize and to create 3D menus, galleries
and other applications that require image loading and distortion. For the first time, we present packages of custom classes.
(Cross-referenced with Advanced Section.)
-
A Custom HorizontalSlider AS3 Class in Action: Applying Color Tints to Photos
We present custom HorizontalSlider and a VertcalSlider AS3 classes that provide a light-weight alternative to the built-in
Flash CS3 slider component. The HorizontalSlider class extends Sprite and dispatches custom events. As an example
of usage, we construct an applet in which color tints are applied to a photo.
-
Loading Images and Spinning Them in 3D in Terms of AS3 Custom Classes - Take 2
We show how to use custom AS3 classes to construct a Flash CS3 applet where a couple of two-sided images can be span in 3D. This time,
images are loaded at runtime from external files. The concurrent loading is done by a custom ImageLoader class that extends
the EventDispatcher class. We show how to create custom events in AS3.
-
Flipping a Card Applet in Terms of ActionScript 3 Custom Classes - Take 1
We show how to change our very popular Card Flips applet so at first most and then all the code
resides in custom AS3 classes. We create an image flipping AS3 class. We use
the class to create a two-card applet. We also introduce and discuss
the Document Class in Flash CS3.
-
Introduction to Writing and Using Custom ActionScript 3 Classes with Flash CS3
In this first tutorial, we discuss the three ways that AS3 custom classes can be used with Flash CS3. Then we present
a simple applet. In the initial version of the applet, the code is placed on the MainTimeline. We show how to move the code into
a custom class. Then we use the class to construct variations on the applet.







