+612 9045 4394
Foundation ActionScript for Macromedia Flash MX 2004 : Foundation - Sham Bhangal

Foundation ActionScript for Macromedia Flash MX 2004


Paperback Published: 22nd April 2005
ISBN: 9781590593059
Number Of Pages: 461

Share This Book:
Ships in 5 to 9 business days

Flash guru Sham Bhangal brings us the third edition of everybodys favorite beginner level Flash scripting book: Foundation ActionScript. With the release of Flash MX 2004, scripting in Flash has moved from being a desirable asset to an essential skill in the world of web design and development. ActionScript is, quite simply, the key to real power in Flash. Flash is now both a design tool and a development tool, and ActionScript can easily scare designers. This book is for anyone who has ever looked in awe at a cutting-edge Flash site, then taken a look at some code, and run in the other direction. Learning ActionScript with friends of ED will not turn you into a boring programmer, it will turn you into someone who finally has the power to achieve what they want with their web design, and can liberate their creative urges. This book will take you from knowing nothing about ActionScript to a firm knowledge that will allow you to exercise a previously unimaginable amount of power over your Flash movies. It does this with fully worked examples throughout, and a case study that will leave you with a cutting-edge Flash site by the end of the book.

Industry Reviews

From the reviews:

"By the end of the book, you should be comfortable with programming in ActionScript, even if you've never touched a line of code in your life, such is the eloquent way this tome is presented." - Practical Web Projects

"Aimed specifically at designers who may not be programming-minded but wish to create powerful online content. ... the guide eases you into the language gently ... . presented in an easy-to-follow manner and take you effortlessly through a range of techniques that are ideal for programming games ... . By the end of the book, you should be comfortable with programming in ActionScript, even if you've never touched a line of code in your life, such is the eloquent way this tome is presented." (Practical Web Projects, May, 2005)

About the Authorp. xiv
About the Technical Reviewerp. xv
Introductionp. xvii
Interactive Flashp. 1
Giving your movies instructionsp. 2
Working with the Actions panelp. 3
Direct typingp. 5
Who are you talking to?p. 9
Controlling movie clips on the stagep. 10
Argumentsp. 14
Listening to what your movies are telling youp. 14
Events in Flashp. 15
External eventsp. 15
Internal eventsp. 16
Introducing callbacksp. 16
Nesting spiders--argh!p. 17
Animating movie clips with ActionScriptp. 18
Summaryp. 20
Making plansp. 23
Defining the problemp. 24
Keep your ideas in a safer place than your headp. 25
Storyboardingp. 26
Building your ActionScriptp. 30
Thinking from the top downp. 30
Thinking from the bottom upp. 31
Flowchartingp. 33
Book project: Introducing the Futuremedia sitep. 37
Deconstructing the problemp. 40
p. 43
p. 45
p. 47
Parting shotsp. 51
Summaryp. 51
Movies that rememberp. 53
Introducing variablesp. 54
Values and typesp. 55
Creating variables and using them with literals and expressionsp. 56
Naming variablesp. 56
Creating variablesp. 58
Literal valuesp. 58
Expressionsp. 59
Input and outputp. 62
Using string expressionsp. 67
Working with numbersp. 68
Other uses for numeric expressionsp. 69
Working with Boolean valuesp. 70
Logic operatorsp. 71
Arraysp. 72
Reasons for using arraysp. 73
Arrays let you store related information togetherp. 73
Arrays let you hold information in a specific orderp. 73
Arrays let you index informationp. 73
Arrays let you link informationp. 74
Creating a new arrayp. 74
Typing an arrayp. 75
Using variable values as offsetsp. 75
Book project: Starting the Futuremedia site designp. 77
What you're going to dop. 77
What you're going to learnp. 78
Choosing and setting the stage sizep. 78
Setting up the timelinep. 79
Creating layout guidesp. 80
Adding the position and status textp. 82
Choosing a fontp. 82
Adding the textp. 83
Embedding the fontp. 85
Parting shotsp. 86
Summaryp. 87
Movies that decide for themselvesp. 89
Decision makingp. 90
Making decisions in ActionScript: The if actionp. 91
Defining a decisionp. 92
Alternative actionsp. 98
Acting on alternatives: The else actionp. 98
More than one alternative: The else if actionp. 100
Handling lots of alternatives: The switch actionp. 103
Switching without breaksp. 105
Summaryp. 112
More power, less scriptp. 115
Timeline loopsp. 116
ActionScript loopsp. 117
While loopsp. 117
Useful things to do with while loopsp. 118
for loopsp. 125
initp. 126
conditionp. 126
nextp. 126
Some useful examples of for loopsp. 126
Simple loopp. 126
Reverse loopp. 126
Two at a timep. 126
Looping through elements in an arrayp. 127
Applying an operation to all the elements in an arrayp. 127
Searching an array for a specific valuep. 128
Cross-indexing a pair of arraysp. 129
Hangmanp. 129
Book project: Creating the static graphicsp. 141
Setting up the timeline layers for your graphicsp. 143
Creating the back stripp. 143
Adding structure to the Libraryp. 145
Creating the frame cutoutp. 146
Revealing the frame cutout and finishing the FLAp. 148
Parting shotsp. 148
Summaryp. 149
Movies that remember how to do thingsp. 153
Breaking down a taskp. 154
Bundling actions and running them afterwardp. 154
Choosing which actions to bundle and wherep. 158
Arguments and redundancyp. 159
Local variables and modular codep. 160
Returning values from a functionp. 162
Typing functionsp. 163
Nesting functionsp. 168
Summaryp. 172
Objects and classesp. 175
Introducing objects and classesp. 176
Type and object-oriented programmingp. 177
Classes, generalization, and abstractionp. 178
Seeing arrays in a new lightp. 178
The Array constructor methodp. 179
Other Array methodsp. 180
Array propertiesp. 180
Creating classes and objects (instances) in Flashp. 181
Instancesp. 181
The Object objectp. 181
Viewing an object in Flashp. 182
Constructorsp. 183
Objects, objects, everywherep. 186
Lurking objectsp. 186
Making a show reelp. 187
Summaryp. 201
Objects on the stagep. 203
Movie clips and buttons as objectsp. 204
Symbol behaviorp. 206
Two sides of the same objectp. 206
Working with Library itemsp. 207
Navigating the timelinesp. 211
Different place, different variablep. 211
Locating variables from inside a callback functionp. 211
Reusing callbacksp. 212
Changing the scopep. 215
Global variablesp. 217
Summaryp. 219
Modular ActionScriptp. 221
Modular ActionScriptp. 222
Black-box programmingp. 222
Creating componentsp. 223
Creating a modular set of playback controlsp. 224
Dark Valentinep. 231
Using your component with Dark Valentinep. 232
Modular control of movie clipsp. 233
How to simulate realistic movementp. 234
Linear motionp. 234
Motion with accelerationp. 235
Trailing the pointer (a mouse follower)p. 237
Understanding the inertial codep. 242
Fine-tuning the componentp. 242
Modular code and functionsp. 245
Swarming behaviorp. 245
Taking the swarming effect forwardp. 248
Book project: Starting to codep. 249
The Futuremedia code stylep. 249
Making it modularp. 249
Writing the code to set up the events and function hierarchyp. 250
Sanity check #1p. 251
Setting up the event handler callbacksp. 253
Invoking the color changep. 253
Sanity check #2p. 254
Running the FLA: The resultsp. 254
Parting shotsp. 256
Summaryp. 256
Spritesp. 259
What is a sprite?p. 260
Controlp. 261
External and local datap. 261
Movementp. 264
Collisionp. 264
Planning zapperp. 269
The game world (the main timeline)p. 271
scorep. 272
level, skill, and accelp. 273
speedp. 273
shipDead, fired, and gSHIP_HEIGHTp. 273
The timelinep. 273
The codep. 275
Global constantsp. 275
The "start game" triggerp. 276
The player (the ship)p. 278
The SwarmAlienp. 282
alienSpawn0p. 283
onEnterFramep. 283
alienBrain0p. 283
alienReincarnate0p. 283
The SwarmAlien codep. 284
The bulletp. 288
The debris of warp. 289
Book project: Navigation event handlingp. 290
Sanity check #1p. 292
Adding the basic UI animationp. 292
navigate and posTransitionp. 295
Adding typingp. 299
Sanity check #2p. 299
Creating a smooth transitionp. 299
Parting shotsp. 306
Summaryp. 307
Drawing APIp. 309
Turtle graphicsp. 310
Drawing linesp. 311
Drawing curvesp. 313
How the sketching code worksp. 317
Filling shapesp. 317
Creating a kaleidoscopep. 320
Kaleidoscope mathp. 320
Building the kaleidoscope enginep. 322
Book project: Color transition event handling and datap. 328
Wiring the colTransition functionp. 328
The game planp. 328
Fading colorp. 330
Coding the color transitionp. 331
Finishing the text transitionp. 332
Reviewing the code so farp. 333
Data-driven sites (and why you need to understand them)p. 334
Defining data for Futuremediap. 335
Parting shotsp. 341
Summaryp. 341
Soundp. 343
Adding sound to Flash moviesp. 344
Using the Sound classp. 346
Playing sounds from ActionScriptp. 347
Controlling sound from ActionScriptp. 358
setVolume0p. 358
setPan0p. 358
Dealing with large sound files: Compression and streamingp. 366
Compressionp. 366
External sound filesp. 367
Book project: Adding data to the Futuremedia sitep. 370
Creating the data structurep. 371
Defining your datap. 372
Page type pTypep. 372
Page links pLinkp. 372
Page titles titlep. 372
Setting the content linkage identifier and URLp. 374
Populating the data with default valuesp. 374
Populating the actual data valuesp. 375
Creating the Futuremedia configurationp. 378
Populating the configuration filep. 381
Getting Flash to read the datap. 384
Populating the eventsp. 387
Reading content pagesp. 388
Parting shotsp. 390
Summaryp. 391
Advanced ActionScriptp. 393
Componentsp. 394
Components and ActionScriptp. 397
Using component properties and methodsp. 398
Components and event handlingp. 400
A Flash UIp. 403
Formsp. 404
Removing componentsp. 407
Removing listenersp. 408
Components and bandwidthp. 408
Revisiting classes, objects, methods, and propertiesp. 408
Prototypesp. 410
ActionScript 2.0 classesp. 415
How class-based coding worksp. 416
Book project: Finishing the Futuremedia sitep. 421
Going backwardp. 421
Adding the backward pathp. 421
Create each icon as new pages are addedp. 422
Delete icons as they're used to navigate backwardp. 422
Display a new animation transition that shows the effects of backward navigationp. 422
Make sure that the UI knows where it needs to returnp. 422
Tidying up the UIp. 428
Tidying up the graphicsp. 429
Adding sound and interface status messagesp. 432
A great big sanity checkp. 432
Adding soundp. 434
Adding the status text messagesp. 437
Another sanity checkp. 437
Forward pathp. 438
Backward pathp. 438
Testing the sitep. 439
Adding a preloaderp. 441
Parting shotsp. 443
Summaryp. 445
Indexp. 446
Table of Contents provided by Ingram. All Rights Reserved.

ISBN: 9781590593059
ISBN-10: 1590593057
Series: Foundation
Audience: General
Format: Paperback
Language: English
Number Of Pages: 461
Published: 22nd April 2005
Publisher: Apress
Country of Publication: US
Dimensions (cm): 23.01 x 19.1  x 2.52
Weight (kg): 0.79
Edition Number: 2
Edition Type: Revised