Skip to main content


ActionScript 3.0 Bible

Roger Braunstein, Mims H. Wright, Josuha J. Noble

ISBN: 978-0-470-24193-6 December 2007 800 Pages


This description refers to the first edition of ActionScript 3.0 Bible. For the greatly revised and updated second edition published in April 2010, search on author Roger Braunstein’s name or for ISBN 0470525231. ActionScript has matured into a full-fledged, object-oriented programming language for creating cutting-edge Web applications, and this comprehensive book is just what you need to succeed. If you want to add interactivity to Flash, build Flex applications, or work with animation — it's all here, and more. Packed with clear instruction, step-by-step tutorials, and advanced techniques, this book is your go-to guide to unlock the power of this amazing language. Learn the basics, apply object-oriented programming, and more.

Part I: Getting Started with ActionScript 3.0.

Chapter 1: Introducing ActionScript 3.0.

Chapter 2: Understanding ActionScript 3.0 Language Basics.

Chapter 3: Programming with Classes.

Chapter 4: Working with Methods and Functions.

Chapter 5: Validating Your Program.

Part II: Working with ActionScript 3.0 Objects.

Chapter 6: Using Strings.

Chapter 7: Working with Numbers and Math.

Chapter 8: Using Arrays.

Chapter 9: Using Objects.

Chapter 10: Working with XML.

Chapter 11: Working with Regular Expressions.

Part III: Working with the Display List.

Chapter 12: Understanding the Flash Player 9 Display List.

Chapter 13: Working with DisplayObjects in Flash CS3.

Chapter 14: Printing.

Chapter 15: Working with Text and Fonts.

Part IV: Understanding the Event Framework.

Chapter 16: Understanding Events.

Chapter 17: Working with Mouse and Keyboard Events.

Chapter 18: Using Timers.

Part V: Working with Error Handling.

Chapter 19: Understanding Errors.

Chapter 20: Using the AVM2 Debugger.

Chapter 21: Making Your Application Fault-Tolerant.

Part VI: Working with External Data.

Chapter 22: Understanding Networking Basics.

Chapter 23: Communicating with Server-Side Technologies.

Chapter 24: Saving Data to a Local Machine Using SharedObject.

Chapter 25: Managing File Uploads and Downloads.

Part VII: Enriching Your Program with Sound and Video.

Chapter 26: Working with Sound.

Chapter 27: Adding Video.

Chapter 28: Accessing Microphones and Cameras.

Part VIII: Programming Graphics and Motion.

Chapter 29: Applying Filters to Your Graphics.

Chapter 30: Drawing Vector Graphics Programmatically.

Chapter 31: Scripting Animation.

Chapter 32: Applying Transformations to Graphics.

Chapter 33: Drawing Bitmap Graphics Programmatically.

Part IX: Working with Binary Data.

Chapter 34: Working with Binary Data.

Part X: Deploying Your Program.

Chapter 35: Deploying Flash on the Web.

Chapter 36: Interfacing with JavaScript.

Chapter 37: Using Local Connections to Communicate Between Flash Applications.


Partial code submitted for the book (remaining code to come)
Complete code from the book
Partial code submitted for the book (remaining code to come)
Complete code from the book
ChapterPageDetailsDatePrint Run
27VideoButton Code
The following code is the VideoButton file needed to create the video button for the FLV Playback Application in Chapter 27. The download file contains the updated code files for chapter 27.

package com
import flash.display.Sprite;
import flash.text.TextField;

public class VideoButton extends Sprite
public static const CLICKED:String = "clicked";
private var text:TextField;

public function VideoButton(value:String)

graphics.beginFill(0xFFFFFF, 1);
graphics.drawRoundRectComplex(0, 0, 30, 20, 3, 3, 3, 3);

text = new TextField();
text.height = 20;
text.width = 30;
text.text = value;

addEventListener(MouseEvent.MOUSE_DOWN, dispatchClick);


private function dispatchClick(mouseEvent:MouseEvent):void
var event:Event = new Event("clicked");


28519Error in Code
The code that begins on the bottom of page 519 was accidentally duplicated on page 521. The code that should appear on page 521 is as follows:

import flash.display.Sprite;

public class CameraToNetStream extends Sprite

private var netStream:NetStream;
private var netConnect:NetConnection;
private var cam:Camera;
private var mic:Microphone;

public function CameraToNetStream()
cam = Camera.getCamera();
mic = Microphone.getMicrophone();
netConnect = new NetConnection();
netStream = new NetStream(netConnect);

30568Replace code
Replace code on page with:
package { import flash.display.*; import; import flash.geom.Matrix; import; public class BitmapDataRect extends Sprite { private var shape:Sprite; private var loader:Loader; private var bmpImage:BitmapData; public function BitmapDataRect() { loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, picLoaded); loader.load(new URLRequest("")); // Make a sprite into which to draw the shape. shape = new Sprite(); // Move the sprite so it's visible on stage. shape.x = 100; shape.y = 100; addChild(shape); } private function picLoaded(event:Event):void { trace("Loaded"); // Define a BitmapData object with dimensions identical to the sprite bmpImage = new BitmapData(loader.width, loader.height); // Draw the image into the BitmapData object. bmpImage.draw(loader); // Draw a shape, and use the BitmapData object as the bitmap fill.;, [0x00ff00, 0xff0000], [100, 100], [150, 255]); // Set the line gradient style to apply a linear gradient that goes from // yellow to cyan with yellow at the left edge and cyan at the right // edge. var mxBox:Matrix = new Matrix(); mxBox.createGradientBox(200, 200);, [0xFFFF00, 0x00FFFF], [100, 100], [0x00, 0xFF], mxBox);;, 0, 200, 200);; } } }