![]() ActionScript 3.0 Bible
ISBN: 978-0-470-13560-0
Paperback
792 pages
October 2007
US $49.99
This price is valid for United States. Change location to view local pricing and availability.
View Previous Edition of This Title
Other Available Formats: Adobe E-Book
|
Instructors may request an evaluation copy for this title.
|
Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.
| Chapter | Page | Details | Date | Print Run |
|---|---|---|---|---|
| 27 | VideoButton 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; import flash.events.MouseEvent; import flash.events.Event; public class VideoButton extends Sprite { public static const CLICKED:String = "clicked"; private var text:TextField; public function VideoButton(value:String) { super(); 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; addChild(text); addEventListener(MouseEvent.MOUSE_DOWN, dispatchClick); } private function dispatchClick(mouseEvent:MouseEvent):void { var event:Event = new Event("clicked"); dispatchEvent(event); } } } |
04/02/08 | ||
| 28 | 519 | Error 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: package { import flash.net.NetConnection; import flash.net.NetStream; import flash.media.Camera; import flash.display.Sprite; import flash.media.Microphone; 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(); netConnect.connect("myServerUrl"); netStream = new NetStream(netConnect); netStream.attachCamera(cam); netStream.attachAudio(mic); } } } |
11/14/07 | |
| 30 | 568 | Replace code Replace code on page with: package { import flash.display.*; import flash.events.Event; import flash.geom.Matrix; import flash.net.URLRequest; 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("http://www.rightactionscript.com/samplefiles/image2.jpg")); // 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. shape.graphics.lineStyle(25); shape.graphics.lineGradientStyle(GradientType.LINEAR, [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); shape.graphics.lineGradientStyle(GradientType.LINEAR, [0xFFFF00, 0x00FFFF], [100, 100], [0x00, 0xFF], mxBox); shape.graphics.beginBitmapFill(bmpImage); shape.graphics.drawRect(0, 0, 200, 200); shape.graphics.endFill(); } } } |
11/14/07 |


