E-Book, Englisch, 450 Seiten
McSharry / YardFace / Webster Foundation ActionScript 3.0 with Flash CS3 and Flex
1. ed
ISBN: 978-1-4302-0196-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 450 Seiten
ISBN: 978-1-4302-0196-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
This book teaches ActionScript to both aspiring ActionScript developers and experienced ones who want to upgrade their knowledge to the new version. It details how to use ActionScript through both Flash CS2 and Flex 2 (open source ActionScript developers should also be able to make use of the book). Coverage focuses on essential real world techniques and assumes no previous ActionScript knowledge. In addition, the book features a host of practical examples; reference sections are also included at the back of the book allowing the reader to easily look up syntax.
Sean McSharry has been a Flash developer and designer since 1999 (Flash 3). He runs the popular Flashcoder blog (Flashcoder.net/blog). He has consulted in many business sectors from oil exploration to banking to Internet protocol television (IPTV), for major industry leaders such as Microsoft and Adobe Consulting. He is an Adobe Certified Flash Developer and Designer and has worked on everything from banners to massive rich Internet applications. He has worked in Europe and America and is the director of creative research and development for AKQA in New York. He uses the entire Flash platform in his development (Flash, ActionScript, Flash Lite, Flash Media Server, etc.). He is a pre-release tester for many Adobe products and is actively involved in the Flash community. He strongly believes that Flash developers and designers should be as comfortable with and passionate about code as they are about aesthetics and design. 'Flash allows you to bring everything together in one development environment for many platforms. So to produce the best work you need to be skilled in coding, design, video, audio, stills production, etc. Even if you don't actually do them, you have to have a good understanding of them all if you want to produce the best work.'
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;1
2;Copyright Page;2
3;CONTENTS AT A GLANCE;4
4;Table of Contents;5
5;ABOUT THE AUTHORS;15
6;ABOUT THE TECHNICAL REVIEWER;16
7;ABOUT THE COVER IMAGE DESIGNER;17
8;Chapter 1 GETTING STARTED WITH ACTIONSCRIPT 3.0;19
8.1;A brief history of ActionScript;20
8.2;Flash CS3 and Flex 2;20
8.3;ActionScript and object-oriented programming;22
8.4;The development process;22
8.5;Organizing your files;25
8.6;Adding ActionScript to your projects;26
8.6.1;Placing code on the timeline;26
8.6.2;Importing code from an external file;28
8.6.3;Specifying a document class;29
8.6.4;Linking library assets to external classes;30
8.7;Bouncing balls;33
8.7.1;Creating the Flash file;33
8.7.2;Creating the Ball class;35
8.7.3;Adding more balls;37
8.8;ActionScript in action;38
8.9;Summary;39
9;Chapter 2 ACTIONSCRIPT 3.0 FUNDAMENTALS;41
9.1;Statements and expressions;42
9.2;Introducing variables;43
9.2.1;Assigning a value to a variable;44
9.2.2;Retrieving the value of a variable;45
9.2.3;Naming your variables;47
9.2.4;Understanding data types;48
9.2.4.1;Boolean data type;49
9.2.4.2;Numeric data types;49
9.3;Constants;51
9.4;Performing operations;52
9.4.1;Arithmetic operators;52
9.4.2;Specifying precedence;53
9.4.3;String operations;54
9.4.4;Unary operations;54
9.5;Introducing arrays;55
9.5.1;Manipulating arrays;57
9.6;Making decisions;59
9.6.1;Introducing the if statement;59
9.6.2;Forming Boolean expressions;60
9.6.3;Booleans in conditionals;62
9.6.4;Using Boolean operators;63
9.7;Looping the loop;64
9.7.1;The while loop;65
9.7.2;The do . . . while loop;68
9.7.3;The for loop;69
9.7.4;Looping through an array;69
9.7.5;More for loops;70
9.7.6;Breaking out of a loop;71
9.8;Introducing functions;71
9.8.1;Creating a function;73
9.8.2;Returning a value from a function;73
9.8.3;Using function parameters;76
9.8.4;Providing a default value for function parameters;77
9.8.5;Allowing for variable parameters;77
9.8.6;Passing values and references;78
9.8.7;Function scope;80
9.9;Commenting your code;82
9.9.1;Bad vs. good comments;83
9.9.2;Commenting for documentation;84
9.10;Summary;84
10;Chapter 3 OBJECTS AND CLASSES;87
10.1;The iPod analogy;88
10.2;Working with objects;89
10.2.1;Creating objects using the new operator;89
10.2.2;Accessing properties and calling methods;90
10.2.3;Copying objects;91
10.2.4;Casting objects to a type;92
10.2.5;The Object object;94
10.2.6;Iterating over objects;96
10.3;Creating your first class;98
10.3.1;Choosing suitable names for your classes;99
10.4;Adding properties;100
10.5;Adding methods;102
10.5.1;Initializing your objects with a constructor method;105
10.6;Controlling access to properties and methods;107
10.7;Adding getter/setter methods;109
10.7.1;Creating read-only properties with getter methods;112
10.8;Static properties and methods;113
10.9;Taking advantage of inheritance;114
10.9.1;Overriding methods of the base class;117
10.10;Using packages to group your classes;119
10.10.1;Naming your packages;119
10.10.2;Importing a class from a package;120
10.10.3;Importing all classes in a given package;121
10.10.4;Resolving naming conflicts among imported classes;121
10.11;Removing dependency on timeline code;122
10.12;Summary;122
11;Chapter 4 WORKING WITH THE DISPLAY;124
11.1;Introducing the display list;125
11.2;Working with display objects;127
11.2.1;Manipulating display objects;131
11.2.2;Managing depth;135
11.2.2.1;Discovering the depth of objects;136
11.2.2.2;Manipulating the depth of objects;138
11.2.2.3;Swapping depths;139
11.2.3;Creating new display objects;141
11.2.4;Removing display objects from the display list;143
11.3;Specifying blend modes;143
11.4;Working with filters;145
11.4.1;Applying a filter to a display object;145
11.4.2;Applying filters in a specific order;150
11.4.3;Making changes to an existing filter;151
11.4.4;Removing an existing filter;155
11.4.5;Introducing the advanced filters;157
11.5;Accessing the stage;159
11.5.1;Using Stage properties;159
11.5.2;Making a movie full screen;159
11.6;Using Library resources;163
11.7;Loading from external files;166
11.7.1;Loading an external asset;166
11.7.2;Manipulating the loaded asset;169
11.8;Making things move;169
11.8.1;Copying animation from the timeline;169
11.8.1.1;Creating the animation;170
11.8.1.2;Copying the animation code;171
11.8.2;Looping the animation;174
11.8.3;Animating other properties;175
11.8.4;Understanding the animation XML;175
11.9;Summary;176
12;Chapter 5 CREATING VECTOR GRAPHICS WITH THEDRAWING API;178
12.1;Why we need a Drawing API;178
12.2;Understanding the Drawing API;181
12.3;Setting up Mr. Smiley;181
12.4;Drawing lines;183
12.4.1;Creating straight lines;183
12.4.2;Controlling the line style;185
12.4.3;Drawing curved lines;187
12.5;Drawing and filling shapes;188
12.5.1;Drawing primitive shapes;188
12.5.2;Creating custom shapes;190
12.5.3;Filling shapes with a solid color;191
12.5.4;Filling shapes with color gradients;194
12.6;Simplifying the code;198
12.7;Creating gradient line styles;200
12.8;Summary;206
13;Chapter 6 USER INTERACTION AND MORE WITH EVENTS;208
13.1;Understanding events;209
13.1.1;Listening for an event;210
13.1.2;Removing an event listener;211
13.1.3;Naming your event listener methods;212
13.1.4;Creating a simple drawing application;212
13.1.4.1;Setting up the canvas;212
13.1.4.2;Adding event listeners;214
13.1.4.3;Refreshing the screen;218
13.1.5;Using one event listener for multiple objects;219
13.2;Using events with the display list;219
13.2.1;Handling single and double mouse clicks;219
13.2.2;Handling mouse hover states;223
13.2.2.1;Responding to a rollover event;224
13.2.2.2;Making colors constants;228
13.2.3;Handling key presses;229
13.2.3.1;Setting up a keyboard drawing application;230
13.2.3.2;Handling crosshair movement;233
13.2.4;Preventing an event’sdefault action;238
13.3;Capturing and bubbling: the event flow;242
13.3.1;Listening for events in the bubble phase;243
13.3.2;Listening for events in the capture phase;244
13.3.3;Stopping an event from propagating;244
13.3.4;Removing capture phase event listeners;245
13.4;Summary;245
14;Chapter 7 WORKING WITH VIDEO;247
14.1;Video on the modern Web;247
14.1.1;The video experience;248
14.1.2;Where ActionScript comes in;249
14.2;Encoding your video;250
14.2.1;Capturing your video;251
14.2.2;Using the Flash Video Encoder;253
14.3;Delivering your video;257
14.4;Using ActionScript to play videos;260
14.4.1;Managing connections with the NetConnection class;262
14.4.2;Loading and controlling video with the NetStream class;263
14.4.2.1;Buffering your video;264
14.4.2.2;Playing your video;265
14.4.2.3;Pausing your video;265
14.4.2.4;Stopping your video;265
14.4.2.5;Fast-forwarding and rewinding your video;265
14.4.3;Creating video objects with the Video class;267
14.4.4;Creating camera objects with the Camera class;268
14.4.5;Handling video events;271
14.4.5.1;Mouse events;271
14.4.5.2;Status events;272
14.4.5.3;Metadata events;273
14.4.5.4;Cue point events;276
14.5;Building a video player;278
14.5.1;Setting up the project;279
14.5.1.1;Creating the Main.as file;280
14.5.1.2;Creating the Video.as file;280
14.5.2;Controlling the video player;283
14.5.2.1;Setting up the status text field;283
14.5.2.2;Implementing the loading progress bar;284
14.5.2.3;Creating the playhead bar;285
14.5.2.4;Handling the metadata;287
14.5.2.5;Handling cue points;288
14.5.3;Controlling the video on the stage;289
14.5.3.1;Adding button functionality;290
14.5.3.2;Finishing the Videos.as class;296
14.5.4;Creating a custom event;303
14.6;Summary;303
15;Chapter 8 USING AUDIO;306
15.1;Importing and converting sound files;307
15.1.1;Using iTunes;307
15.1.1.1;Converting to MP3 format;307
15.1.1.2;Adding ID3 information;308
15.1.2;Using Soundbooth;309
15.2;Using ActionScript to play sound;309
15.2.1;Accessing sound files with the Sound class;310
15.2.2;Controlling sound channels with the SoundChannel class;310
15.2.3;Doing security checks with the SoundLoaderContext class;311
15.2.4;Controlling volume and panning with the SoundTransform class;311
15.2.5;Controlling sounds globally with the SoundMixer class;312
15.2.6;Getting ID3 data with the ID3Info class;313
15.2.7;Using a microphone with the Microphone class;313
15.2.8;Understanding the basics of a sound player application;314
15.2.8.1;Preloading a buffer;315
15.2.8.2;Pausing sound;316
15.2.8.3;Stopping sound;317
15.2.8.4;Fast-forwarding and rewinding sound;318
15.2.8.5;Controlling volume;319
15.2.8.6;Controlling panning;320
15.2.8.7;Displaying the sound spectrum;320
15.2.8.8;Handling ID3 events;323
15.3;Building a sound player;325
15.3.1;Setting up the project;326
15.3.1.1;Creating the Main.as file;327
15.3.1.2;Creating the Sounds.as file;328
15.3.1.3;Loading the sound file;330
15.3.1.4;Buffering sound;331
15.3.2;Adding display items;331
15.3.2.1;Creating the loading progress bar;331
15.3.2.2;Creating the playhead bar;332
15.3.2.3;Adding the sound spectrum;334
15.3.2.4;Displaying ID3 track metadata;336
15.3.3;Controlling the audio as it plays;336
15.3.3.1;Adding button functionality;337
15.3.3.2;Handling button events;342
15.3.4;Controlling the sound volume and panning;346
15.3.5;Creating the custom event class;355
15.4;Summary;356
16;Chapter 9 WORKING WITH COMPONENTS;358
16.1;Just what are components?;359
16.1.1;Accessing your components;360
16.1.2;Adjusting parameters;360
16.2;Benefits of working with components;364
16.3;Exploring the Flash component framework;365
16.3.1;UI components;365
16.3.2;Video components;367
16.3.3;Going behind the scenes;368
16.3.4;Finding the files;369
16.3.4.1;Components directory;370
16.3.4.2;Component Source directory;371
16.4;Scripting interaction;374
16.4.1;Adding the components;375
16.4.2;Adding the ActionScript;377
16.5;Styling and skinning;382
16.5.1;Styling components;382
16.5.1.1;Setting up for changing styles;383
16.5.1.2;Setting styles for all components;384
16.5.1.3;Setting a style for all instances of a component;385
16.5.1.4;Setting the style for a single instance of a component;385
16.5.2;Skinning using the timeline;386
16.5.3;Skinning using classes;389
16.5.3.1;Creating a skin for the button’s up state;389
16.5.3.2;Creating skins for the button’s other states;390
16.5.3.3;Associating the skins with the buttons;391
16.6;Creating components from scratch;393
16.6.1;Creating the widget;393
16.6.2;Writing the component code;395
16.6.2.1;Handling events;396
16.6.2.2;Rotating the dial;397
16.6.2.3;Getting and setting dial values;398
16.6.2.4;Adding metatags;400
16.6.3;Turning the symbol into a component;401
16.6.4;Testing the component;402
16.7;Using third-party components;403
16.8;Summary;404
17;Chapter 10 REGULAR EXPRESSIONS;406
17.1;Why we need regular expressions;407
17.2;Introducing the RegExp class;409
17.3;The anatomy of a regular expression pattern;409
17.3.1;Introducing metacharacters;411
17.3.2;Using anchors to restrict the position of matches;411
17.3.3;Providing alternatives using alternation;412
17.3.4;Using character classes and character ranges;413
17.3.5;Matching any character using the dot metacharacter;414
17.3.6;Matching a number of occurrences using quantifiers;414
17.3.6.1;Matching zero or one occurrence;415
17.3.6.2;Matching zero or more occurrences;416
17.3.6.3;Matching one or more occurrences;416
17.3.6.4;How to prevent greedy quantifiers;416
17.3.6.5;Being more specific with bounds;417
17.3.7;Grouping patterns;418
17.3.8;Accessing matched strings with backreferences;419
17.3.8.1;Using backreferences with the String.replace() method;420
17.3.8.2;Using backreferences after the pattern has been matched;421
17.4;Understanding the e-mail regular expression pattern;422
17.5;Changing regular expression behavior with modifiers;423
17.5.1;Using the case-insensitive modifier;424
17.5.2;Using the global modifier;424
17.5.3;Using the multiline modifier;425
17.5.4;Using the dotall modifier;426
17.5.5;Using the extended modifier;426
17.6;Using variables to build a regular expression;427
17.7;Useful regular expressions;427
17.8;Regular expression resources;428
17.9;Summary;428
18;Chapter 11 USING XML;431
18.1;Understanding XML and E4X;432
18.1.1;XML document components;432
18.1.1.1;Root node;432
18.1.1.2;Elements;432
18.1.1.3;Attributes;433
18.1.1.4;Text nodes;433
18.1.2;E4X;434
18.2;Accessing an XML file;434
18.2.1;Creating an XML object;434
18.2.2;Loading an XML file;434
18.2.3;Getting XML from a remote source;436
18.3;Reading the XML;436
18.3.1;Reading the root node;436
18.3.2;Reading elements in an XML tree;436
18.3.3;Reading an XML element’s attributes;437
18.4;Searching XML;438
18.4.1;Searching for an attribute or element at any level;439
18.4.2;Reading text nodes;441
18.5;Modifying XML;442
18.5.1;Adding elements to an XML object;442
18.5.2;Removing elements and attributes from an XML object;445
18.6;Summary;445
19;Chapter 12 CASE STUDY:CREATING A DYNAMIC IMAGE VIEWER;447
19.1;An overview of the image viewer;448
19.2;Laying out the interface;449
19.3;Creating the document class;455
19.4;Loading image data;460
19.4.1;Loading the XML;462
19.4.2;Parsing the data;463
19.4.3;Accessing the data;464
19.5;Displaying images;466
19.5.1;Handling image selection;468
19.5.2;Scaling an image;470
19.6;Adding graphic enhancements;470
19.6.1;Changing the image label;471
19.6.2;Improving the thumbnail layout;471
19.6.3;Adding drop shadows;473
19.6.4;Creating an animated transition;475
19.7;Summary;479
20;Chapter 13 GETTING STARTED WITH FLEX 2;481
20.1;Introducing Flex 2;482
20.2;Understanding rich Internet applications;482
20.3;Meet the (Flex) family;482
20.3.1;The Flex framework;483
20.3.2;Flash Player 9;483
20.3.3;MXML;483
20.3.4;Flex 2 Software Development Kit;484
20.3.5;Flex Builder 2;484
20.3.6;Flex Data Services;484
20.3.7;Adobe AIR;485
20.4;Getting started with the Flex 2 SDK;485
20.4.1;Installing the Flex 2 SDK;485
20.4.1.1;Windows XP/Vista;486
20.4.1.2;Mac OS X;488
20.4.1.3;Linux;488
20.4.2;Finding a suitable editor;488
20.4.3;Building your first Flex 2 application;488
20.5;Getting started with Flex Builder 2;492
20.5.1;Understanding the Flex Builder 2 interface;492
20.5.2;Building your first Flex Builder 2 application;493
20.5.2.1;Creating a new Flex project;493
20.5.2.2;Working in Design view;495
20.5.2.3;Working in Source view;499
20.6;Summary;500
21;Chapter 14 FLEX BY EXAMPLE;502
21.1;Planning the application;503
21.1.1;Gathering the requirements;503
21.1.2;Creating the functional specification;504
21.1.3;Designing the UI;505
21.1.4;Designing the interaction;507
21.1.5;Designing the data and logic;507
21.2;Setting up the project;507
21.3;Creating the basic UI;509
21.4;Creating basic feed integration;512
21.4.1;Installing the XML syndication library;512
21.4.2;Creating the Subscription class;516
21.4.2.1;Testing the Subscription class;518
21.4.2.2;Loading the data;520
21.4.2.3;Allowing Subscription instances to be used for data binding;525
21.4.3;Creating the subscriptions list;528
21.4.4;Creating the articles data grid;531
21.4.5;Populating the Article panel;534
21.5;Completing the Subscriptions panel;535
21.5.1;Allowing users to subscribe to a feed;535
21.5.1.1;Laying out the SubscribeDialog component;536
21.5.1.2;Wiring up the buttons;537
21.5.1.3;Getting the feed;540
21.5.2;Allowing users to unsubscribe from a feed;546
21.5.3;Saving the subscriptions list between sessions;546
21.5.4;Refreshing the subscriptions list;549
21.5.4.1;Automatically refreshing the subscriptions list;549
21.5.4.2;Manually refreshing the subscriptions list;550
21.6;Completing the Articles and Article panels;552
21.6.1;Finishing the Articles panel;552
21.6.2;Finishing the Article panel;557
21.7;Improving the feed reader;559
21.8;Summary;560
22;INDEX;562




