Errors and Omissions

Chapter 2

p. 55, Test Question 5. This exercise should be restricted to lossless compression.

Chapter 3

p. 98, Test Question 4. This question should start: In Figure 3.24, which of the two lower shapes …

Chapter 14

p. 557. In the 3rd line of the code fragment in the middle of the page there is a superfluous . between the ) and [.

p. 560ff. (This isn't exactly an error, but we advise you to make the following changes to be consistent with the behaviour of popular Web browsers.) Change the first paragraph of the section headed "Events and Listeners" to the following:

The method addEventListener is an example of a method that takes a function as one of its arguments. addEventListener takes three arguments. The first is a string, whose value is the name of an event; the second is a function which will act as the listener for events of that type. We use the function’s name only, because we are passing the function object, not calling it. For simple cases, the third argument is always false.

This change reflects the behaviour of the current versions of Firefox and Opera, which consider omitting the final argument to be an error. Safari allows it to be omitted, which appears to be the behaviour specified in the ECMAScript standard. (Internet Explorer does not implement addEventListener at all.) For consistency, the third argument should be added to the calls of addEventListener in the remaining JavaScript examples. (Note that this argument can be omitted in ActionScript, and usually is, so no change is necessary to the examples in the ActionScript part of the chapter.)

p. 560. 5 lines from the bottom, change to

switch1.addEventListener("click", plainify, false)

p. 563. Change the two calls in the function prepare to

switch1.addEventListener("click", plainify, false)
switch2.addEventListener("click", fancify, false)
and the call below it to
window.addEventListener("load", prepare, false)

p. 565. Change the call at the end of do_switch to

the_switch.addEventListener("click", the_listener, false)

p. 574. Add at the end of the last sentence: ", but the third argument can be omitted."

Chapter 15

p 608. Add the following before the polyline element on the last line:

<circle cx="50" cy="50" r="50" fill="#F67155" stroke="none" />

p. 622, Test Question 9. This question may need some clarification. Change the first sentence to:

Show how you can use a combination of transforms in SVG to scale a 300 × 400 pixel rectangle with a red fill, whose top left corner is at (150, 200), by a factor of 1.5, without altering the position of the top left corner.