Errata

Essential ActionScript 3.0

Errata for Essential ActionScript 3.0

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 41
Method Signatures examples

"In ActionScript, a method signature also includes each parameter's datatype and the method's return type."

The example of the signature for the eat method is given as eat(numberOfCalories).

Shouldn't it show the datatype of the parameter?

The example of the getAge method is given as
getAge().

Shouldn't it indicate the method's return type?

DJPJ  May 15, 2010 
Printed Page 43

In the example 1-2. Zoo program, the eat() instance method should be invoked in the VirtualZoo class. The VirtualZoo() constructor should be:

public function VirtualZoo() {
this.pet = new VirtualPet("Stan");
this.pet.eat(50); // missing line
}

Daniel Scherly  Dec 21, 2009 
Printed Page 43
Paragraph "VirtualZoo class"

The code line:

this.pet.eat(50);

has disappeared from the public function VirtualZoo.

The code line exists on page 38 first paragraph.

Ebbe Blomgren  Aug 02, 2010 
Printed Page 59
Both code blocks in the bottom of page

I found that the codeblock in Chapter 2: Boolean logic, page 59 has an operator switch.
It says:

if (xPosition < 0 || xPosition > 100){
// This code executes if xPosition is between 0 and 100
}

, which it will not because the comparison has switched the operators.

T?mas Thorvardarson  Jan 26, 2010 
PDF Page 59
2nd paragraph from bottom

if (xPosition < 0 || xPosition > 100) {
// This code executes if one of either xPosition is between
// 0 and 100, inclusive
}
is this code correct?
As for my opinion this is bul**hit. I have spent half an hour to try to understand secret sense :)

Anonymous  Aug 09, 2011 
PDF Page 83
bottom of 83 page

Function "contains" must be static, but in example it's not static:
public function contains (string, character){
->
public static function contains (string, character){

Anonymous  Jul 04, 2009 
Printed Page 83
Example code at bottom of page

Second line of example code:
"public function contains (string, character) {"

should read:
"public static function contains (string, character) {"

Bob Pierce  Aug 06, 2009 
Printed Page 130
1st paragraph and instruction list

Where 'src' is stated as the directory for the .as files, it should be 'zoo'. Or the other way around. The .as directory has to be 'zoo' and the document class referenced in the main .fla file must be 'zoo.VirtualZoo'. The source directory and the document class prefix must match for the compiling to work.

David Lawter  Jun 13, 2009 
Printed Page 130
1st paragraph

book details the source code for the virtual zoo program residing in virtualzoo/src/ whereas it should actually reside in virtualzoo/zoo. Otherwise the package zoo will not compile properly.

reha baydar  Oct 18, 2010 
Printed, PDF Page 151
In table 8-3, at bottom

The "result after conversion" description for "Number or int" says that it's an integer in the range 0 -- 2^31-1, but the upper bound is actually 2^32-1 (because it doesn't need the extra bit for the sign).

Matt Tenenbaum  Feb 18, 2011 
Printed Page 168
second code block

Change comment from 'Displays' to 'Contains', since serialize method doesn't run a trace or generate any form of output.

Jeremy Flowers  Jul 16, 2010 
Printed Page 194
5th paragraph

The code snippet explaining Array.push() and returning length is incorrect.

var list:Array = [12,23,98];
trace(myList.push(28,36));

It uses "list" in the first line, then "myList" in the 2nd.

Eirik Hoem  Jul 06, 2009 
Printed Page 197
Second last line

The line "Invoke push( ), unshift( ),or splice( ) on the array" should be "Invoke pop( ), unshift( ),or splice( ) on the array".

This error also appears on the Safari Books Online version.

camden_kid  Jul 10, 2009 
Printed Page 466
code following 2nd paragrah

Code as printed doesn't draw a rectangle or circle unless I add "this.addChild(rectAndCircle);" to the GreetingApp constructor

Ken Graham  Mar 18, 2010 
Printed Page 471
addChildAt note contradicts what follows on P472/P473

You say in note 'if depth is occupied', new child goes behind...
But in triangle example that follows, triangle is the new child and it's added at position where circle was. Triangle is the 'new child'. It's not added BEHIND circle. It's added in FRONT of circle. Circle and subsequent items are shunted down one position to make space.
Consequently note on P471 contradicts what follows. I'd assume what follows is correct...

Jeremy Flowers  Jul 18, 2010 
Printed Page 474
Last but one line

To move on -> To move one. A missing 'e'.

Jeremy Flowers  Jul 18, 2010 
Printed Page 479
1st and 2nd code blocks in WordHighlighter function

missing semicolons when adding 1st and 2nd textfields to word1 and word2

word1.addChild(text1)

word2.addChild(text2)

Ken Graham  Mar 24, 2010 
PDF Page 500
Example 20-10

I believe that
import flash.display.*;
should be
import flash.text.*;

and

html = true;
isn't defined.

ReAnimator  Nov 25, 2009 
Printed Page 559
first link

the following link is no longer working:

http://livedocs.macromedia.com/flash/8/main/00001686.html

Colin Moock
Colin Moock
 
Aug 02, 2010 
Printed Page 608
private function renderListener(e:Event)

In this example of render-optimisation, the function clearChanged() is never called by the ellipse class.
It would seem to me that the renderListener function should be calling this function once the screen is updated:

private function renderListener(e:Event):void{

if(hasChanged())
{
draw();
clearChanged();// this should be added.
}


}

Is this correct?

Gerard  Mar 14, 2010 
Printed Page 639
setStroke Style arguments near to of page

I thought the avoidance of 'magic numbers' and adherence to named constants was something you were trying to instil. Yet scale mode and joints arguments don't refer to constants on page 639, in the same way they do on page 638. I'd suggest fixing this in future editions.

Jeremy Flowers  Jul 19, 2010 
Printed Page 739
The way you embed fonts - P739/740 / Ex 27-11 & P739 text

This is more of a suggestion than an error.
I picked this tip up from Yakov in the Enterprise Development with Flex book...
Use symlinks (or for the poor souls using (Yuck!) Microsoft - Junction - You can find this via System Internals.
This way if two users on different machines setup a font folder symbolic link (like an alias for XP), they can do so by using conventions across the team. Makes more sense in bigger organisations, where people may have different configurations of hardware/software/ Operating systems/fonts/links to server resources etc.

Jeremy Flowers  Jul 19, 2010 
Printed Page 739
Example 27-11

In the example 27-11, and in all embedding font example in this chapter, if you compile with Flex SDK 4.0 you have to add

embedAsCFF="false"

in [Embed] metadata tag:

[Embed(source="c:/windows/fonts/verdana.ttf",
fontFamily="Verdana", embedAsCFF="false")]

otherwise no text appear on the screen.

Matteo Legittimo  Nov 17, 2010 
Printed Page 784
Half way down page : After second set of bullet points

Use the tthe external.... - remove typo/duplication 'tthe'

Jeremy Flowers  Jul 20, 2010 
Printed Page 789
after 4th paragraph (3rd code block with bolded text)

<FONT FACE="Times New Roman">
"In certain situations, this security limitation can be avoided using <I>import loading</I>, wherein <i>Main.swf</I> uses a <I>LoaderContext </I>object to import <I>Module.swf</I> into its security domain. The following code demonstrates:
</FONT>
<BR>
<FONT FACE="Courier New">
&nbsp;&nbsp;&nbsp;var loaderContext:LoaderContext = new LoaderContext();
&nbsp;&nbsp;&nbsp;<B>loaderContext.applicationDomain = ApplicationDomain.currentDomain;</B>
&nbsp;&nbsp;&nbsp;var loader:Loader = new Loader();
&nbsp;&nbsp;&nbsp;loader.load(new URLRequest("Module.swf"));</FONT>
<BR>
<FONT FACE="Times New Roman">
For complete information on import loading, see the section "Import Loading" in Chapter 19."
<P></P>
Upon noting that it didn't change anything other than the formatting of the previous code block, I was confused and refreshed myself as per suggestion of Chapter 19. There I noticed the definition of import loading on P. 447:
"Using the</FONT><FONT FACE="Courier New"> securityDomain</FONT><FONT FACE="Times New Roman"> to gain distributor permission to import a <I>.swf</I> file's classes into an application domain (as shown in the preceding code) is known as <I>import loading</I>."
<BR>
Thus, I think the code block should be rewritten as follows:
</FONT>
<BR>
<FONT FACE="Courier New">
&nbsp;&nbsp;&nbsp;var loaderContext:LoaderContext = new LoaderContext();
&nbsp;&nbsp;&nbsp;loaderContext.applicationDomain = ApplicationDomain.currentDomain;
&nbsp;&nbsp;&nbsp;<B>loaderContext.securityDomain &nbsp;&nbsp;&nbsp;= SecurityDomain.currentDomain;</B>
&nbsp;&nbsp;&nbsp;var loader:Loader = new Loader();
&nbsp;&nbsp;&nbsp;loader.load(new URLRequest("Module.swf"));</FONT>

Cassandra Boykin  Jul 13, 2009 
Printed Page 789
after 4th paragraph (3rd code block with bolded text)

Sorry about the HTML, here is a more readable version:
(if this doesn't support BB Code either, [b]bolded stuff[/b] is where it is bolded, and later represents where I suggest the bolding be placed.)

"In certain situations, this security limitation can be avoided using import loading, wherein Main.swf uses a LoaderContext object to import Module.swf into its security domain. The following code demonstrates:

var loaderContext:LoaderContext = new LoaderContext();
[b]loaderContext.applicationDomain = ApplicationDomain.currentDomain;[/b]
var loader:Loader = new Loader();
loader.load(new URLRequest("Module.swf"));

For complete information on import loading, see the section "Import Loading" in Chapter 19."

Upon noting that it didn't change anything other than the formatting of the previous code block, I was confused and refreshed myself as per suggestion of Chapter 19. There I noticed the definition of import loading on P. 447:
"Using the securityDomain to gain distributor permission to import a .swf file's classes into an application domain (as shown in the preceding code) is known as import loading."

Thus, I think the code block should be rewritten as follows:
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
[b]loaderContext.securityDomain = SecurityDomain.currentDomain;[/b]
var loader:Loader = new Loader();
loader.load(new URLRequest("Module.swf"));

Cassandra Boykin  Jul 13, 2009 
Printed Page 792
First block of code

Missing public in the first block of code:

package {
import flash.display.MovieClip;
class Module extends MovieClip {

// Define the event constant
public static const ASSETS_READY:String = "ASSETS_READY";

}
}

Should be:

package {
import flash.display.MovieClip;
public class Module extends MovieClip {

// Define the event constant
public static const ASSETS_READY:String = "ASSETS_READY";

}
}

Matteo Legittimo  Nov 19, 2010 
Printed Page 807
Third line from bottom of page

Consequently typo. Consequesntly!

Jeremy Flowers  Jul 20, 2010 
Printed Page 825
3rd paragraph

3rd line, "Frames 4 though 7" should be "Frames 4 thRough 7" ;)

Mattia  Feb 19, 2010 
Printed Page 873
Note block

Page 873 of EAS3 says " ActionScript 2.0 developers should note that no _exclude.xml file is required; the _exclude.xml file system is not supported in Flash CS3."

That statement is misleading.

It should read something like the following (very approximate):

"ActionScript 2 developers familiar with the _exclude.xml files (see Chapter 14 of "Essential Action 2.0" for details) should still use those when working with AS2 files in Flash CS3. Flash CS3 still supports the _exclude.xml files for AS2 compilation. However, when using AS3, Flash CS3 does not require _exclude.xml files." (I think it automatically minimizes the use of classes)

Bruce Epstein  Dec 12, 2010