ActionScript: The Definitive Guide by Colin Moock This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was updated on April 9, 2002 Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: [108] last paragraph; "If the divisor is zero, the result is NaN" is incorrect. It isn't feasible to make the full correction for this in a reprint. The full correction is as follows: If the divisor (denominator) is zero: The result is NaN if the numerator is zero or non-numeric The result is Infinity if the numerator is a positive number The result is -Infinity if the numerator is a negative number Some examples: trace (0/0); // NaN trace ("a"/0); // NaN trace (1/0); // Infinity trace (-1/0); // -Infinity Note that if the numerator is Infinity: The result is NaN if the divisor is Infinity, -Infinity, or non-numeric The result is Infinity if the divisor is zero or a non-infinite positive number The result is -Infinity if the divisor is a negative, non-infinite number Some examples: trace(Infinity/Infinity); // NaN trace(Infinity/-Infinity); // NaN trace(Infinity/"a"); // NaN trace(Infinity/0); // Infinity trace(Infinity/1); // Infinity trace(Infinity/1000); // Infinity trace(Infinity/-1); // -Infinity trace(-Infinity/2); // -Infinity trace(-Infinity/-2); // Infinity Note finally that any non-infinite number divided by Infinity is 0 trace (0/Infinity); // 0 trace (1/Infinity); // 0 trace (-1000/Infinity); // 0 {109} first code sample on page; In the code sample that checks for a zero divisor, line 3 is missing curly braces around the else statement. Line 3 should read: } else { {127} second code sample; In the second code sample on the page, the diameter variable is incorrectly set to ball.radius instead of ball.radius * 2. Line 1 of the code should read: diameter = ball.radius * 2; {137} second code sample on page; In the second code sample on the page, the value of Math.PI is missing a "1". Line 3 of the code should read: trace("pi is: " + PI); // Displays: 3.14159... (PI is a property of Math) (297) Footnote to Figure 13-4; The word "no" at the end of the first line of the footnote should be "not" (the "t" is missing). Thus, the footnote should read "...contains clips not based..." instead of "...contains clips NO based..." {373} tip text; The MIME type in the tip text (marked by an owl graphic), is incorrectly listed as: "application/x-www-urlform-encoded". The correct MIME type is: "application/x-www- form-urlencoded" (as specified by the W3C). This error also appears under loadVariables() (p.489), XML.contentType() (p.610), and XML.send() (p.626). {522} frameNumber argument for MovieClip.gotoAndPlay(); When passed a below-range frame number, the MovieClip.gotoAndPlay() method actually behaves differently than the global gotoAndPlay() function. The second line of the frameNumber argument for MovieClip.gotoAndPlay() should, hence, be replaced with: "If frameNumber is less than 1, the call to MovieClip.gotoAndPlay() is ignored. If frameNumber is greater than the number of frames in mc's timeline, the playhead is sent to the last frame. Note that this behavior differs from the global version of gotoAndPlay(), where a value less than 1 is treated as 1." {523} frameNumber argument for MovieClip.gotoAndStop(); When passed a below-range frame number, the MovieClip.gotoAndStop() method actually behaves differently than the global gotoAndStop() function. The second line of the frameNumber argument for MovieClip.gotoAndStop() should, hence, be replaced with: "If frameNumber is less than 1, the call to MovieClip.gotoAndStop() is ignored. If frameNumber is greater than the number of frames in mc's timeline, the playhead is sent to the last frame. Note that this behavior differs from the global version of gotoAndStop(), where a value less than 1 is treated as 1."