Skip to Content
Beginning ActionScript 2.0
book

Beginning ActionScript 2.0

by Nathan Derksen, Jeff Berg
April 2006
Beginner
835 pages
19h 56m
English
Wrox
Content preview from Beginning ActionScript 2.0

Appendix A. Exercise Answers

Chapter 1

There are no actual solutions to the exercises in Chapter 1, which were created simply to help you become accustomed to the Flash IDE, where you'll be spending quite a bit of time as you work through this book.

Chapter 2

Exercise 1 Solution

  1. Valid. It is a combination of a declaration and an assignment, which is allowed in a single statement.

  2. Not valid. The data type Integer does not exist. The Number data type should be used instead.

  3. Not valid. Strong typing requires use of the var statement.

  4. Not valid. A variable name cannot start with a number.

  5. Valid, but not recommended. The variable name is also used as a property for the MovieClip class.

  6. Not valid. Data of type String is being assigned to a variable of type Boolean. The quotes should be removed.

Exercise 2 Solution

The contents of the round brackets are evaluated first, so numItemsPrepaid is subtracted from numItemsPickedUp. Next, the multiplication is evaluated, with the results of the subtraction multiplied by perItemCost. That result is then added to handlingFee, and that final answer is assigned to totalAmount.

Exercise 3 Solution

The final value is 130.

Exercise 4 Solution

The output is

blue jay-crow-warbler

Chapter 3

Exercise 1 Solution

var shoppingCart:Array = new Array();
shoppingCart.push({modelNumber:"ip300", description:"MP3 Music Player", 
Exercise Answers
price:299, quantity:1}); shoppingCart.push({modelNumber:"ip300c", ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Essential ActionScript 2.0

Essential ActionScript 2.0

Colin Moock
ActionScript 2.0 Language Reference for Macromedia® Flash® 8

ActionScript 2.0 Language Reference for Macromedia® Flash® 8

Francis Cheng, Jen deHaan, Robert L. Dixon, Shimul Rahim

Publisher Resources

ISBN: 9780764577680Purchase book