【目录】 Preface PartⅠ Getting Started Chapter 1 ActionScript Overview What Is ActionScript 3.0? The Flash Platform Procedural Versus Object-Oriented Programming The Document Class Legacy Code Compatibility Chapter 2 Core Language Fundamentals Miscellaneous Basics Variables and Data Types Conditionals Loops Arrays Functions Custom Objects this Absolute versus Relative Addresses PartⅡ Graphics and Interaction Chapter 3 Properties, Methods, and Events Inherited Attributes Properties Events Methods Event Propagation Frame and Timer Events Removing Event Listeners Chapter 4 The Display List The Sum of Its Parts Adding and Removing Children Managing Object Names, Positions, and Data Types Changing the Display List Hierarchy A Dynamic Navigation Bar Chapter 5 Timeline Control Playhead Movement Frame Labels Frame Rate A Simple Site or Application Structure Chapter 6 OOP Classes Inheritance Composition Encapsulation Polymorphism Navigation Bar Revisited Chapter 7 Motion Basic Movement Geometry and Trigonometry Physics Programmatic Tweening Timeline Animation Recreations Particle Systems Chapter 8 Drawing with Vectors The Graphics Class The Geometry Package The Motion Package 9-Slice Scaling Applied Examples Chapter 9 Drawing with Pixels Bitmap Caching The BitmapData Class Blend Modes Bitmap Filters Color Effects Image Encoding and Saving PartⅢ Text Chapter 10 Text Creating Text Fields Setting Text Field Characteristics Selecting Text Formatting Text Formatting with HTML and CSS Triggering ActionScriot from HTML Links Parsing Text Fields Loading HTML and CSS PartⅣ Sound and Video Chapter 11 Sound ActionScript Sound Architecture Internal and External Sounds Playing, Stopping, and Pausing Sounds Buffering Streaming Sounds Changing Sound Volume and Pan Reading ID3 Metadata from MP3 Sounds Visualizing Sound Data Working with Microphone Sound Waveform Visualization Chapter 12 Video Encoding Components Full-screen Video Captions Coding Your Own Video Playback PartⅤ Input/Output Chapter 13 Loading Assets Loading Sound and Video Loading Text Loading Display Objects Communicating Across ActionScript Virtual Machines Taking a Brief Look at Security Chapter 14 XML and E4X Understanding XML Structure Creating an XML Object Reading XML Writing XML Deleting XML Elements Loading External XML Documents Communicating with XML Servers An XML-Based Navigation System PartⅥ Programming Design and Resources Chapter 15 Programming Design and Resources Programming Design Methodologies Object-Oriented Design Patterns Resources Index
【文摘】 Much discussion has been made over the pros and cons of procedural ver-sus object-oriented programming. To touch briefly on this, here is a littlebackground concerning the evolution of ActionScript. ActionScript startedas a sequential programming language, meaning that scripting was limitedto a linear sequence of instructions telling Flash what to do in a step-by-stepmanner. This approach to scripting was not terribly flexible and did notpromote reuse.As the language evolved, it became a procedural programming language.Like sequential programming, procedural programming relied on a step-by-step set of instructions but introduced a more structured, modular approachto scripting. Procedures, otherwise known as functions (or, sometimes, sub-routines), could be executed again and again as needed from different partsof a project, without copying and pasting copies of the code into the ongoingsequence of instructions. This modularity promoted reuse, and made thecode easier to edit and more efficient.Scripters in search of an even greater degree of modularity and reuse gravitat-ed toward object-oriented programming. OOP languages create programs thatare a collection of objects. Objects are individual instances of classes——collec-tion of code that are self-contained and do not materially alter or disrupteach other. Dividing code into small capsules, appropriately known as encap-sulation, is one of the hallmarks of an OOP language. Another important fea-ture of OOP is inheritance, or the ability to derive classes from parent classes,passing on specific characteristics from the parent.A classic example of OOP structure, and specifically inheritance, defines a setof transportation vehicles. You might start with a generic Vehicle class thatincludes traits common to all vehicles, such as the basic physics of movement.You might then create three subclasses: GrounclVehicle, WaterVehicle, andAirVebicle. These classes would alter or introduce traits specific to ground,water, and air travel, respectively, but not yet be complete enough to repre-sent an actual vehicle. Further derived classes might be Car and Motorcycle(descending from GroundVehicle), Boat, and Submarine (descending fromWaterVehicle), and Plane and Helicopter (descending f~~om AirVehicle).Depending on the complexity of your system, you can carry on this process,.creating individual models with individual settings for fuel consumption,friction, and so on.As you can probably imagine, this approach to development adds additionalpower, flexibility, and prospects for reuse. These benefits, among others,sometimes position object-oriented programming as the best approach to aproblem. However, there is a tendency among some programmers to believethat OOP is the best solution to all problems or, effectively, the only solution.This is a faulty assumption.
以下为对购买帮助不大的评价