The web site for Flash ActionScript 3.0 game developers

 
         
   

Book Corrections

When you try to write a 400 page book in 3 months, things are bound to slip through the cracks. Here are some corrections to the text.

Chapter 10: Player can click on the right answer after they get one wrong.
The problem here lies in one line of code in the finishQuestion() function. The line should read:

answerSprites.getChildAt(i).removeEventListener(MouseEvent.CLICK,clickAnswer);

Notice the getChildAt(i) inserted. This matches the property changes in the rest of the function. It will properly turn off the answers as buttons. You'll need to do this for all the finishQuestion() functions in the various trivia games.

Chapter 2, Page 63: The line "var b:Number = .05;" shouldn't be there.

Chapter 2, Page 68: Player can click on the right answer after they get one wrong.
The code in the book shows a lowercase "e" for "event". It should be "Event".

addEventListener(Event.ENTER_FRAME,checkCollision);

Chapter 3, Page 95: The section called "Adding Keyboard Listeners" should be titled "Adding Mouse Listeners."

Chapter 3, Page 103: The filename in bold should be "MatchingGame7.fla" not "MatchingGameObject7.fla".

Chapter 4, Page 131: The second time on the page in the code that "textMessage.selectable = false;" appears it should be "textScore.selectable = false;".

Chapter 5, Page 163: In the example file Airplane.as, this line is included right before the "// set up animation" comment.

this.gotoAndStop(Math.floor(Math.random()*5+1));

In the text on page 163, it is left out. The line simply chooses a random frame of the Airplane movie clip so one of five plane graphics can be displayed. The game works with or without it.

Chapter 6, page 213: In the clearPuzzle() function, the addEventListener should be removeEventListener.



Copyright Gary Rosenzweig