did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781592000364

Macromedia Flash Mx 2004 Game Programming

by ;
  • ISBN13:

    9781592000364

  • ISBN10:

    1592000363

  • Format: Paperback
  • Copyright: 2003-11-06
  • Publisher: Cengage Learning Ptr
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.99

Summary

Provides techniques for using Flash in creating computer games, covering such topics as functions, handlers, arrays, movie objects, physics, and artificial intelligence.

Table of Contents

Letter from the Series Editor xxiii
Introduction xxv
Part One Getting Started
1(78)
The Flash Authoring Tool
3(24)
Interface
4(2)
Creating a New Movie
6(1)
The Stage
6(1)
The Tools Panel
7(2)
The Library
9(2)
Importing Graphics and Sound
11(1)
Text Fields
12(1)
Static Text Fields
13(1)
The Properties Panel
13(2)
The Transform Panel
15(2)
The Timeline
17(3)
Frames
17(1)
The Playhead
17(1)
Keyframes
18(1)
Layers
18(2)
Frame Labels
20(2)
Scenes
22(1)
Adding a Simple Tween
22(1)
Previewing a Movie
23(1)
Testing a Movie
23(1)
Publishing a Movie
23(2)
Conclusion
25(2)
Flash ActionScript
27(52)
The Actions Panel
28(1)
Where Does the Script Go?
29(6)
Frame Scripts
30(2)
Frame Scripts in Movie Clips
32(1)
Instance Scripts and Event Handlers
33(2)
The Output Panel
35(3)
Syntax Error Reports
35(1)
The trace Function
36(2)
Variables
38(1)
Operators
39(2)
Operator Precedence
41(2)
More Operators
43(4)
Pre-Increment and Post-Increment (++)
44(1)
Pre-Decrement and Post-Decrement (--)
44(1)
Modulus (%)
45(1)
Compound Assignments (+=, -=, *=, /=, %=)
46(1)
Semicolons
47(1)
Keywords
47(1)
Comments
48(1)
Line Comments
49(1)
Block Comments
49(1)
Types
49(3)
Strings
50(1)
Numbers
51(1)
Booleans
51(1)
Literals
52(1)
Even More Operators
52(3)
Greater Than (>, >=)
52(1)
Less Than (<, <=)
53(1)
Equivalence (==)
53(1)
Not Equal To (!=)
54(1)
The NOT Operator (!)
54(1)
Curly Braces
55(1)
Conditional Statements
55(10)
The if Conditional
55(1)
The else Conditional
56(1)
The else if Conditional
57(2)
The Nested Conditional
59(1)
The switch Statement
60(5)
Code Blocks
65(1)
Loops
66(4)
The while Loop
66(1)
The do while Loop
67(1)
The for Loop
68(2)
Variable Type Conversion
70(3)
Number to Boolean
70(1)
Boolean to Number
70(1)
Number to String
71(1)
String to Number
72(1)
String to Boolean
72(1)
Boolean to String
73(1)
Logical Operators
73(5)
The AND Operator (&&)
73(1)
The OR Operator (||)
74(1)
Logical Operator Precedence
75(1)
Using NOT (!) and the Logical Operators
76(1)
Logical Short Circuit
77(1)
Conclusion
78(1)
Part Two Beginner Games
79(290)
Programming Interactivity: Mouse Chaser
81(48)
Functions
82(10)
Built-In Functions
82(6)
User-Defined Functions
88(4)
Scope
92(4)
Block Scope
92(2)
Movie Clip Scope
94(2)
The Dot Operator
96(1)
Properties
96(5)
The _alpha Property
97(1)
The _x and _y Properties
97(3)
The _xscale and _yscale Properties
100(1)
The _width and _height Properties
100(1)
The _visible Property
100(1)
The _rotation Property
101(1)
References
101(6)
The _root Reference
102(1)
The this Reference
103(1)
The _parent Reference
104(2)
Function References
106(1)
The _xmouse and _ymouse Properties
107(1)
Creating Mouse Chaser
108(20)
The Idea
109(1)
Creating the Library Assets
110(5)
Script Organization
115(1)
Implementation
116(10)
Testing
126(1)
Complete Code Listing
127(1)
Conclusion
128(1)
Creating Instances Dynamically: The Button Menu
129(54)
Dynamic Movie Clip Instances
130(11)
Exporting a Library Symbol
130(2)
Creating a Dynamic Clip Instance
132(2)
Movie Clip Depth
134(2)
Removing Dynamic Clips
136(1)
Duplicating Dynamic Clips
136(2)
Creating Empty Clips
138(2)
Dynamic Clip Names: eval
140(1)
Consolidating Scripts
141(1)
Attaching Event Handlers to Dynamic Clips
141(8)
Scoping Rules for Dynamic Event Handlers
143(1)
The onEnterFrame Handler
144(1)
The onLoad Handler
145(1)
The onUnload Handler
145(1)
The onData Handler
146(1)
The Mouse Handlers
146(3)
Buttons
149(9)
The Button States
150(3)
The Button Handlers
153(3)
The Button Hit Area
156(2)
Controlling Movie Playback
158(6)
The stop Function
158(2)
The play Function
160(1)
The gotoAndPlay Function
160(1)
The gotoAndStop Function
161(1)
The nextFrame Function
161(1)
The prevFrame Function
162(1)
The _currentframe Property
162(1)
The _totalframes Property
163(1)
The Button Menu
164(17)
The Button Symbol
165(2)
The Button Implementation
167(12)
Complete Code Listing
179(2)
Reusable Scripts
181(1)
Conclusion
181(2)
Arrays: Match 'Em Up and Sliders
183(68)
What Is an Array?
184(1)
Creating Arrays
185(1)
Accessing Arrays
185(1)
Array Members
186(18)
Array Properties
186(1)
Array Methods
187(17)
Initializing Arrays
204(1)
Nested Arrays
204(1)
Multidimensional Arrays
205(3)
Accessing Movie Clip Properties as an Array
208(2)
Creating Match 'Em Up
210(19)
The Idea
210(1)
Creating the Library Assets
210(1)
Script Organization
210(1)
Implementation
211(11)
Testing
222(4)
Compplete Code Listing
226(3)
Creating Sliders
229(20)
The Idea
229(1)
Creating the Library Assets
230(3)
Implementation
233(12)
Complete Code Listing
245(4)
Conclusion
249(2)
Objects: Critter Attack
251(118)
What Is an Object? The Basics
252(3)
Custom-Made Object Types
253(1)
Global Objects Versus Instance Objects
253(1)
The new Operator
253(1)
Constructors
254(1)
The typeof Operator
254(1)
The delete Operator
255(1)
ActionScript Objects
255(78)
Core Objects (ECMA)
256(25)
Movie Objects
281(51)
Client/Server and Authoring Objects
332(1)
Creating Critter Attack
333(34)
The Idea
333(1)
The Implementation
334(24)
Testing
358(1)
Complete Code Listing
359(8)
Conclusion
367(2)
Part Three Intermediate Games
369(162)
Real-Time Programming: Shoot 'Em Up
371(56)
Timing
372(3)
The setlnterval Function
373(1)
The clearlnterval Function
374(1)
State Machines
375(3)
What Is a Finite State Machine?
375(1)
Drawing a State Machine
375(3)
Creating Shoot 'Em Up
378(47)
The Idea
379(2)
Creating the Art Assets
381(10)
The Design
391(4)
Implementation
395(19)
Sound
414(3)
Testing
417(1)
Complete Code Listing
418(7)
Conclusion
425(2)
Advanced Timing and Trigonometry: Blow 'Em Up
427(76)
Advanced Timing
428(2)
The Problem of Movement
430(1)
Trigonometry
430(10)
A Right Triangle
431(1)
The Pythagorean Theorem
432(1)
The Distance Formula
432(2)
Implementing the Distance Formula in Flash
434(1)
Relative Distance and the Improved Distance Formula
435(2)
The Problem of Movement Revisited
437(3)
Rotation
440(10)
Degrees and Radians
440(2)
The Trigonometric Functions
442(4)
SOHCAHTOA
446(2)
Implementing Rotation in Flash
448(1)
Trigonometry on Any Triangles
449(1)
Creating Blow 'Em Up
450(52)
The Idea
450(2)
The Art
452(4)
The Design
456(6)
The Implementation
462(30)
Testing
492(1)
Complete Code Listing
492(10)
Conclusion
502(1)
Object-Oriented Programming with AS 2.0
503(28)
What Is OOP?
504(2)
Planning
505(1)
Classes
506(13)
Class Functionality
506(1)
Defining a Class
507(4)
Using Classes in Flash
511(2)
Extending Classes
513(1)
Creating Custom Aliens
513(5)
Multiple Inheritance
518(1)
Managing Data in Classes
519(11)
Compile-Time Features
519(8)
Compile-Time and Run-Time Features
527(2)
Using Packages
529(1)
Conclusion
530(1)
Part Four Advanced Games and Topics
531(160)
Artificial Intelligence: Tic Tac Toe
533(48)
Turn-Based Game Al
534(1)
Recursion
535(6)
Recursion Example: Factorial
535(2)
Recursion Example: Power
537(2)
Base Cases
539(1)
Problems with Recursion
540(1)
Trees
541(1)
The Game Tree
542(2)
Minimax Search
544(1)
Creating Tic Tac Toe
545(34)
The Idea
545(1)
The Artwork
545(1)
The Design
546(2)
The Implementation
548(24)
Testing
572(1)
Complete Code Listing
573(6)
Conclusion
579(2)
Physics: Pachinko
581(76)
Vectors
582(8)
Addition and Subtraction with Vectors
584(1)
Scalar Multiplication with Vectors
585(1)
Normalizing a Vector
586(1)
Scaling a Vector
587(1)
Vector Multiplication: The Dot Product
588(2)
Basic Physics
590(23)
Rigid Body Dynamics
590(1)
Mass
591(1)
Velocity
591(1)
Acceleration
591(1)
Force
592(1)
Newton's Laws of Motion
592(2)
Moving Objects
594(1)
Friction
595(1)
Marble Example
596(6)
Collision Response
602(11)
The Time Interval
613(1)
Angular Velocity
614(2)
Creating Pachinko
616(40)
Art
617(8)
Script Design
625(24)
Testing
649(1)
Complete Code Listing
650(6)
Conclusion
656(1)
Server-Side Support for Flash: Highscore Boards
657(34)
Communicating with the Server
658(5)
Loading .swf Files from the Server
659(3)
Loading .jpg Images
662(1)
Preloaders
663(1)
Creating a Preloader
664(10)
Loading Text Files from the Server
668(4)
Triggering Actions at the End of a Load: onData
672(1)
Cross-Domain Security Model
673(1)
Communicating with the Browser
674(2)
Calling a JavaScript Routine from Flash
676(2)
Programming the Server
678(3)
Common Gateway Interface
679(1)
Embedded Languages
679(1)
Other Language Choices
680(1)
Perl
680(1)
Creating a Highscore Board
681(9)
Setting Up Flash for Highscore Boards
681(4)
The Server-Side Scripts
685(4)
Final Tips on Highscore Boards
689(1)
More Server Tricks
690(1)
Conclusion
690(1)
Epilog
691(4)
Appendix A ASCII Character Chart
695(8)
Appendix B Key Object Bindings
703(6)
Appendix C HTML Primer
709(10)
What Is HTML?
710(1)
Tags
710(9)
Required Tags
711(1)
Some Additional Tags
712(3)
Embedded Flash Movies
715(4)
Appendix D Web Resources and Further Reading
719(4)
Flash Links
720(1)
General Game Development Links
721(1)
Math and Number Links
721(1)
Community Links
721(2)
Index 723

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program