page 32 |
 |
Figure 1-8, the object reference this._parent is missing from lines 11, 12, 17, and 18. Those lines should read:
11 this._parent.q1answer = 1;
12 this._parent.gotoAndStop("q2");
17 this._parent.q1answer = 2;
18 this._parent.gotoAndStop("q2");
(Note that the code is correct as listed in the corresponding Example 1-2.)
|
page 34 |
 |
In Example 1-4, the second comment should read:
// Create an onscreen text field to display the user's score.
not
// Create an onscreen text field do display the user's score.
("to" not "do")
|
page 37 |
 |
For the sake of clarity, the last sentence of the first paragraph should indicate the frame on which to place the hypothetical restart button, as follows:
"You can even create a restart button that is available throughout the quiz by making a button instance named restart_btn (placed on its own layer, on frame 1 of the main timeline), and adding the following code to frame 1 of the scripts layer:"
|
page 49-50 |
 |
Before a movie clip is instantiated on a frame, the code on that frame executes. Hence, variable and function definitions on frame 1 of the new movie clip are not accessible to the code on its parent timeline until *after* at least one frame passes. Scenario 3 needs adjusting to allow a frame to pass, as follows:
- The second prose paragraph from the bottom of the page 49 should start with the phrase: "to frame 2 of the main movie timeline..." (not "to frame 1 of the main movie timeline").
- The paragraph following the note at the top of page 50 should read: "Second question: if we place the trace(x) and trace(y) statements on frame 1 of our square movie clip instead of frame 2 of our main movie timeline, what will appear in the Output window?" (again, frame "2" of the main movie timeline, not frame "1").
- The third prose paragraph from the bottom of the page 50 should read: "Now we place this code on frame 2 of the main movie:" (not "Now we place this code on frame 1 of the main movie:").
|
page 71 |
 |
Line two of the second code example on the page is missing a closing parenthesis. It should read:
parseInt("1.3a")
not:
parseInt("1.3a"
|
page 82 |
 |
Under "Infinity and Negative Infinity: Infinity and -Infinity", in the second last sentence, the words "an underflow condition" should be changed to "a negative overflow condition". (An "underflow" condition occurs when a number smaller than Number.MIN_VALUE is specified. In ActionScript, an underflow results in 0.)
|
page 110 |
 |
The fourth line of the second code sample on the page should read:
} else if (description !== null) {
not:
} else if (description !=== null) {
(the correct for of the strict equality operator is "!==" not "!===")
|
page 122 |
 |
In Table 5-2, under the "Terms of Equality" column, the last line of the code example for the Number datatype is missing an equals sign. It should be:
+Infinity == -Infinity
not:
+Infinity = -Infinity
|
page 141 |
 |
The last two lines of code in the first code sample on the page mistakenly refer to "myCircle". They should be changed to refer to "theCircle", as follows:
trace(theCircle instanceof Circle); // true
trace(theCircle instanceof Shape); // true
|
page 142 |
 |
The first code sample on the page should read:
this.constructor.prototype.__proto__.methodName.apply(this, arguments);
not:
this.constructor.prototype.__proto__.constructor.apply(this, arguments);
|
page 162 |
 |
In Flash Player 5 format .swf files, the switch statement performs comparisons using the strict equality operator. Hence, the second sentence of the second paragraph on page 162 should be changed from: "When exporting to Flash 4 or Flash 5 format"
to:
"When exporting to Flash 4 format"
|
page 164 |
 |
The third line of the last code sample on the page should read:
trace("i is less than 5");
not:
trace("x is less than 5");
|
page 165 |
 |
The third line of the first code sample on the page should read:
trace("i is less than 5");
not:
trace("x is less than 5");
|
page 173 |
 |
In line 5 of example 8-3, the variable "form" is missing the suffix "_mc". Line 5 should read:
if (form_mc[prop].text == "") {
not:
if (form[prop].text == "") {
|
page 173 |
 |
Example 8-3 uses Flash MX text field objects, but the preamble to the example refers to deprecated input-text variables. The paragraph immediately preceding Example 8-3 should be rewritten as follows:
"The break statement provides a way to halt a process that is no longer worth completing. For example, we can use a for-in loop to build a form-checking routine that cycles through the text fields on a timeline. If a blank text field is found, we alert the user that she hasn't filled in the form properly. We can abort the process by executing a break statement. Example 8-3 shows the code. Note that the example assumes the existence of a movie clip called form_mc that contains a series of text fields named input01_txt, input02_txt, and so on."
|
page 193 |
 |
The last code block on the page should have a semicolon after the close curly brace, as in:
_global.functionName = function () {
statements
};
|
page 210 |
 |
The first example on the page shows how to pass a reference function to another function:
function doCommand (command) {
command(); // Executes the passed function
}
// Some examples:
doCommand(play); // Pass the built-in stop() function (stops the current movie)
doCommand(stop); // Pass the built-in play() function (plays the current movie)
Unfortunately the example does not work because the built-in stop() and play() functions cannot be invoked by reference due to the way they are implemented in the Flash Player. The example would, however, work for custom functions, as in:
function doCommand (command) {
command(); // Executes the passed function
}
function displayTime () {
trace(new Date().toString());
}
doCommand(displayTime);
|
page 210 |
 |
The last line of the second code sample should read:
initFormFields(editFields, handleFieldFocus);
not:
initFormFields(editFields, highlightField);
|
page 225 |
 |
The last sentence of the second prose paragraph under "Listener Events" should read: "Because Stage.onResize() is a listener event..." ("Stage", not "State").
|
page 227 |
 |
In the first paragraph after the warning note, in the second sentence, the phrase "allowing for a entire movie's layout" should read: "allowing for an entire movie's layout" ("an" not "a").
|
page 243 |
 |
Example 10-2 neglects to state the assumptions for the code listing. Immediatlely before the example, the following sentence should be added: "The box_mc clip must be square, and must have an initial size between box_mc.maxHeight and box_mc.minHeight ." For the curious, here's a version of the example that does not impose those limitations (though the added complexity distracts from the example's real focus, event handlers):
// Set oscillation parameters.
box_mc.scaleIncrement = 10;
box_mc.maxHeight = 200;
box_mc.minHeight = 20;
// Start the box off at the maximum size.
var heightRatio = box_mc._height / box_mc.maxHeight;
box_mc._xscale /= heightRatio;
box_mc._yscale /= heightRatio;
// Adjust the scale increment to match the new size.
box_mc.scaleIncrement /= heightRatio;
// Resize the box with each passing frame.
box_mc.onEnterFrame = function () {
if (this._height >= this.maxHeight
|| this._height <= this.minHeight) {
this.scaleIncrement = -this.scaleIncrement;
}
this._xscale += this.scaleIncrement;
this._yscale += this.scaleIncrement;
}
|
page 244 |
 |
Line 20 of Example 10-4 should read:
// Turn the clip dark red when the mouse is off of it
not:
// Turn the clip bright red when the mouse is off of it
|
page 259 |
 |
In line 16 of Example 11-3, "june" should have a capital "J". Line 16 should read:
months.splice(5, 2, "June");
|
page 284 |
 |
In the first paragraph following the warning note, in the list of properties between em dashes, the "yPostion" property should be "yPosition", not "yPostion".
|
page 288 |
 |
The number in last line of the only code sample on the page has a misplaced decimal point. It should be 785398.163397448, not 78.5398163397448.
|
page 302 |
 |
The third line of the third code sample on the page should read:
importantDates.gwenBirthday = "January 17";
not:
var importantDates.gwenBirthday = "January 17";
|
page 333 |
 |
In the second sentence of the tip note, the phrase "or myClip in the movie clip hierarchy" should read: "or theClip in the movie clip hierarchy" ("theClip" not "myClip").
|
page 348 |
 |
The code example immediately following the second bulleted paragraph would cause infinite recursion. It should be changed from:
this.duplicateMovieClip("newClouds_mc", 0);
to:
if (this._name != "newClouds_mc") {
this.duplicateMovieClip("newClouds_mc", 0);
}
|
page 355 |
 |
In the last three lines of example 13-2, the for loop should use the array "theClips" not "myClips", as in:
for (var i = 0; i < theClips.length; i++)
theClips[i].stop();
}
not:
for (var i = 0; i < myClips.length; i++)
myClips[i].stop();
}
|
page 387 |
 |
In the code example following the heading "MovieClip Sub-Subclasses", the Baseball class's superclass constructor should be invoked before the Baseball class's own "init code". Line 3 of the code, which reads:
// ... init code ...
should be moved after line 5, which reads:
super()
|
page 406 |
 |
The second bullet point on the page should be changed from:
"Click on any frame that has a little circle icon on it in the timeline. A circle indicates the presence of ActionScript code."
to:
"Click on any frame that has a little "a" icon on it in the timeline. An "a" indicates the presence of ActionScript code. (On high resolutions, the "a" might look like a little circle.)"
|
page 462 |
 |
The on(keyPress) handler for the Button symbol is case-sensitive. Hence, sentence two of paragraph two of the "Button keyPress Event Handler" entry should read:
"The string can be either the character corresponding to the key (such as "s" or "S", because it is case-sensitive) or a keyword representing the key in the format "<Keyword>".
("because it is case-sensitive" not "because it is case-insensitive").
|
page 507 |
 |
The custom formatTime() function shown in the second code example on the page returns "0:00AM" for 12 AM and "12:00AM" for 12 PM. The corrected function, listed below, correctly shows "12:00AM" for 12 AM and "12:00PM" for 12 PM:
function formatTime (theDate) {
var hour = theDate.getHours();
var minute = theDate.getMinutes() > 9 ?
theDate.getMinutes() : "0" + theDate.getMinutes();
if (hour == 0) {
var timeString = "12:" + minute + "AM";
} else if (hour == 12) {
var timeString = "12:" + minute + "PM";
} else if (hour > 12) {
var timeString = (hour - 12) + ":" + minute + "PM";
} else {
var timeString = hour + ":" + minute + "AM";
}
return timeString;
}
|
page 516 |
 |
The Date.setUTCFullYear() method is listed as having only a year parameter. In actual fact, it also has month and day parameters that function exactly like the parameters of the same name defined by Date.setFullYear().
|
page 525 |
 |
In Table R-6, under "exec" the description incorrectly claims that the special "fscommand" folder must be placed relative to the .swf file that contains the "exec" call. In fact, the "fscommand" folder must be placed relative to the Flash projector that is displaying the .swf file. Hence, the second and third sentences of the description shoud read:
"In Flash MX, the application must reside in a folder named "fscommand" directly beneath the Flash Projector file (if a Projector file resides in /demo/, the application to launch must reside in /demo/fscommand/). For example, to launch someApp.exe, use "fscommand("exec", "someApp.exe")", without the subfolder name /fscommand/.
|
page 548 |
 |
Under -Infinity's "Description" heading, in the last sentence, the words "an underflow condition" should be changed to "a negative overflow condition".
|
page 593 |
 |
Under "See Also", the method "Security.settings.allowDomain()" is listed incorrectly. It should be: "System.security.allowDomain()".
|
page 612 |
 |
In the code example at the top of the page, the calculation used to simulate the rolling of two dice is statistically inaccurate. The code myRandom(2, 12) generates evenly distributed random numbers from 2 to 12, where every number has an equal chance of appearing. For example, a 2 will statistically appear as often as a 7. But with two real dice, a 2 occurs only if there is a 1 on each die, while a 7 occurs for the combinations 1+6, 2+5, 3+4, 4+3, 5+2 and 6+1. Hence, a 7 occurs much more often than a 2 with two real dice. To fix the inaccuracy, the second line of code at the top of the page should read:
twoDice = myRandom(1, 6) + myRandom(1, 6);
not:
twoDice = myRandom(2, 12);
|
page 622 |
 |
The entire "Mouse.removeListener() Method" entry should be moved before the "Mouse.show() Method" entry (so that they are in correct alphabetical order).
|
page 624 |
 |
In Table R-11, the "Type" column for the "trackAsMenu" property should read "Boolean" (it should not be empty).
|
page 625 |
 |
In Table R-12, the "Method description" for "loadMovie()" should read:
"Loads an external .swf or .jpg file into the Player."
(add "or .jpg").
|
page 627 |
 |
In Table R-14, the asterisk next to onLoad() should be removed (in accordance with the erratum for page 684).
|
page 628 |
 |
In Table R-14, under the column "Clip event occurs when...", the rows for onMouseMove() and onMouseUp() should be swapped, so that onMouseMove() reads:
"Mouse pointer moves (even a teensy bit) while the clip is on stage"
and onMouseUp() reads:
"Primary mouse button is depressed and then released while the clip is on stage"
|
page 631 |
 |
Under "Description", in the third code block on the page, the line:
tBall_mc._xscale = 200;
should be changed to:
tBall._xscale = 200;
(Remove the "_mc" after "tBall").
|
page 636 |
 |
The fourth line of code on the page should be changed from:
this.endFill;
to:
this.endFill()
(add parentheses after "endFill").
|
page 637 |
 |
The synopsis for the MovieClip.beginGradientFill() method is missing the word "Gradient". It should read:
mc.beginGradientFill(fillType, colors, alphas, ratios, matrix)
not:
mc.beginFill(fillType, colors, alphas, ratios, matrix)
|
page 649 |
 |
Evgeny Demidov's primer on Bézier curve mathematics and programming is no longer available at http://www.ipm.sci-nnov.ru/~demidov/VRML/Splines/Intro/Bezier.htm, but can be accessed via http://www.people.nnov.ru/fractal/ or the UK mirror: http://www.ddt.pwp.blueyonder.co.uk/evgeny/Intro/Intro.htm. For more information on Bézier curves in Flash, see Timothée Groleau's article, at: http://timotheegroleau.com/Flash/articles/cubic_bezier_in_flash.htm
|
page 650 |
 |
In the description for MovieClip._droptarget , the following sentence:
"A movie clip is considered to be 'over' another clip if the registration point of the dragged clip overlaps any portion of the target clip."
should be changed to:
"A movie clip is considered to be 'over' another clip if the mouse pointer overlaps any portion of the target clip."
|
page 658 |
 |
The bullet points describing the return values of getBytesLoaded() are correct for the Standalone Flash Player and Netscape Flash plugin, but have a minor inaccuracy for the Internet Explorer Flash Player on Windows. When loading a remote .jpg or .swf file, immediately after loadMovie() is called, getBytesLoaded() in the Standalone Player and Netscape returns:
- first 0
- then the real bytes loaded or
- eventually -1 if the file is not found.
But in Internet Explorer, getBytesLoaded() returns:
- first 0
- then -1
- then the real bytes loaded or
- eventually -1 if the file is not found
Hence, in IE6/WINXP, a preloader script that relies on "-1" to indicate "File Not Found" may think that a file is not found, when in fact it is found. Generic preloading code should therefore not rely on -1 to indicte "File Not Found".
|
page 671 |
 |
The synopsis for "loadMovie()" should read:
"Load an external .swf or .jpg file into the Player."
(add "or .jpg").
|
page 684 |
 |
There is a single case where MovieClip.onLoad() actually works for main movies. Hence, the second sentence at the top of the page should be changed from:
"It does not apply to main movies (e.g., _root , _level1 , etc.)."
to
"For main movies, onLoad() works only when assigned on frame one of the movie loaded onto _level0 in the Flash Player."
|
page 694 |
 |
Under MovieClip._rotation's Example heading, the second line of the code sample should read:
box_mc.onEnterFrame = function () {
not:
box_mc.onEnterFrame = function {
|
page 704 |
 |
Under the first See Also on the page, the word "Security" should be lowercase, as in:
"System.security.allowDomain()"
|
page 708 |
 |
The last sentence of the Description heading for MovieClip._xmouse should read: "To obtain a consistent _xmouse coordinate that is always measured relative to the Stage of the base movie in the Player, use _level0._xmouse ."
|
page 710 |
 |
Under MovieClip._ymouse's Example heading, the first line of the code sample should read:
this.onEnterFrame = function () {
not:
onEnterFrame = function () {
|
page 710 |
 |
The last sentence of the Description heading for MovieClip._ymouse should read: "To obtain a consistent _ymouse coordinate that is always measured relative to the Stage of the base movie in the Player, use _level0._ymouse ."
|
page 712 |
 |
The last line of the description of the newline Constant claims that newline is used "usually for display in a text field variable". In that phrase, the word "variable" should be removed. Text field variables applied to Flash 5 only, and are made obsolete by Flash MX's TextField class.
|
page 725 |
 |
Under "Usage" for "Object.__proto__ Property". The first 5 words should read "Overwriting an object's __proto__ property" not "Overwriting an object's constructor property". This was the first erratum reported, and I found it myself! I love the little tyke...gets me all nostalgic...*sniff* |
page 760, 765 |
 |
The SharedObject Object is actually better described as a class that provides methods to create its instances. Hence, the entry heading on page 760 should read "SharedObject Class" instead of "SharedObject Object". The methods getLocal() and getRemote() should be moved from the "Methods" summary into a separate section called "Class Methods". On page 765, the method entry heading "SharedObject.getLocal() Method" should be changed to: "SharedObject.getLocal() Static Method".
|
page 804 |
 |
In the one-line summary of the #strict pragma (immediately following the entry heading), the word "ECMA-26" should be changed to "ECMA-262".
|
page 819 |
 |
Macromedia fixed the bug described in the second last prose paragraph on this page. The final two sentences of the paragraph should be changed from:
"Unfortunately, at the time of writing, a bug prevents this proxy-movie system from working in the current build of Flash Player 6 (6.0.61.0). Macromedia is aware of the issue and is working to address it."
to:
"Unfortunately, in releases of Flash Player 6 prior to version 6.0.47.0, a bug prevents this proxy-movie system from working. Source files demonstrating the technique are available at: http://www.moock.org/asdg/technotes/crossDomainLoad."
|
page 823 |
 |
The targetPath() global function can take a MovieClip, Button, or TextField instance as its sole argument. The entry for targetPath() mentions MovieClip only. The entire entry should be revised to reflect support for Button and TextField. |
page 883 |
 |
The last line of code on the page is missing a ".". It should read:
field2_txt._xscale = -field2_txt._xscale;
not:
field2_txt._xscale = -field2_txt_xscale;
|
page 886 |
 |
Under the Arguments heading, the argument "righMargin" should be changed to "rightMargin". |
page 924 |
 |
The synopsis for XML.contentType should read:
xmlDoc.contentType
not:
xmlDoc.contentTypeAccess |
page 969 |
 |
Macromedia no longer offers an SDK with their file format licence. The entry for "Macromedia Flash file format" should be changed to:
"Here you can obtain the SWF specification, which 'documents the Macromedia Flash file format (SWF), and how to write Macromedia Flash 6 (SWF) files.'." |
page 980 |
 |
In the heading "Updates to Flash Player 6, Build 61", the "61" should be changed to "65". Similarly, in the first sentence that follows, both occurrences of "61" should be changed to "65".
The number "61" should also be changed to "65" in the following places:
- page 804, in the warning note for #strict
- page 819, in the second last sentence of the second last paragraph on the page
|
page 980 |
 |
In the heading "Player Build Updates", the word "Build" should be changed to "Release", which is the formal term used by Macromedia to describe a publicly released Flash Player version. The word "Build" should be changed to "Release" in all subheadings and prose in this section (pp 980-982) and throughout the book.
|
page 990 |
 |
In the last table row on the page, in the left hand column, the entry heading, "Object constructor" should be followed by the phrase "(Flash 5 only)".
|
page 1016 |
 |
Under the term "HEIGHT", the end of the sentence should read:
"of the HTML page height in the browser."
not:
"of the HTML page width in the browser."
|