ActionScript 3.0 精髓(影印版)
ActionScript 3.0 精髓(影印版)
Colin Moock
《ActionScript 3.0精髓》十分清晰地涵盖了ActionScript编程的所有细节。若你此前没有任何编程基础,该书会引导你循序渐进地逐步掌握ActionScript。如果你已具备一定的ActionScript开发经验,这本书将帮助你进一步弥补知识漏洞,并以正规的术语重新思考那些重要概念。

ActionScript 3.0是对Flash编程语言的一次重大升级。它更快、更简洁,而且比以前的各个版本都更为先进。只有《ActionScript 3.0精髓》可以把你所需理解的每一个ActionScript 3.0主要概念都通过明白流畅的语言细细讲述。也只有《ActionScript 3.0精髓》可以让你深入掌控ActionScript 3.0的全部潜力。


· 详尽的ActionScript核心语言概述,包括面向对象编程、类、对象、变量、方法、函数、继承、数据类型、数组、事件、异常、范围、命名空间、XML和安全等。

· 对于可视化交互编程议题的深入探索,如图形显示API、层次化事件处理机制、鼠标及键盘交互、动画、矢量图形、位图、文本与内容加载操作等。

· 开发相关的实用建议,例如将ActionScript与Flash创作工具制作的内容相结合、在Flex Builder 2中使用Flex框架以及生成可重用的代码库等。

作为Flash和ActionScript开发社区的首选资料,很多人将《ActionScript 3.0精髓》一书以作者的名字命名为“The Colin Moock book”。这样命名的理由是:没有其他任何书较之更能深入浅出地阐释ActionScript、研究其细微差别和全部能力并且通过容易理解的方式表述每一件事。Moock多年的悉心研究、实战编程经验以及通过内部渠道与Abobe工程师的沟通,成就了这本无比准确全面的书。如果想学习ActionScript 3.0,你已经来到了正确的起点。
  1. Foreword
  2. Preface
  3. Part I. ActionScript from the Ground Up
  4. 1. Core Concepts
  5. Tools for Writing ActionScript Code
  6. Flash Client Runtime Environments
  7. Compilation
  8. Quick Review
  9. Classes and Objects
  10. Creating a Program
  11. Packages
  12. Defining a Class
  13. Virtual Zoo Review
  14. Constructor Methods
  15. Creating Objects
  16. Variables and Values
  17. Constructor Parameters and Arguments
  18. Expressions
  19. Assigning One Variable's Value to Another
  20. An Instance Variable for Our Pet
  21. Instance Methods
  22. Members and Properties
  23. Virtual Zoo Review
  24. Break Time!
  25. 2. Conditionals and Loops
  26. Conditionals
  27. Loops
  28. Boolean Logic
  29. Back to Classes and Objects
  30. 3. Instance Methods Revisited
  31. Omitting the this Keyword
  32. Bound Methods
  33. Using Methods to Examine and Modify an Object's State
  34. Get and Set Methods
  35. Handling an Unknown Number of Parameters
  36. Up Next:Class-Level Information and Behavior
  37. 4. Static Variables and Static Methods
  38. Static Variables
  39. Constants
  40. Static Methods
  41. Class Objects
  42. C++and Java Terminology Comparison
  43. On to Functions
  44. 5. Functions
  45. Package-Level Functions
  46. Nested Functions
  47. Source-File-Level Functions
  48. Accessing Definitions from Within a Function
  49. Functions as Values
  50. Function Literal Syntax
  51. Recursive Functions
  52. Using Functions in the Virtual Zoo Program
  53. Back to Classes
  54. 6. Inheritance
  55. A Primer on Inheritance
  56. Overriding Instance Methods
  57. Constructor Methods in Subclasses
  58. Preventing Classes from Being Extended and Methods
  59. from Being Overridden
  60. Subclassing Built-in Classes
  61. The Theory of Inheritance
  62. Abstract Not Supported
  63. Using Inheritance in the Virtual Zoo Program
  64. Virtual Zoo Program Code
  65. It's Runtime!
  66. 7. Compiling and Running a Program
  67. Compiling with the Flash Authoring Tool
  68. Compiling with Flex Builder 2
  69. Compiling with mxmlc
  70. Compiler Restrictions
  71. The Compilation Process and the Classpath
  72. Strict-Mode Versus Standard-Mode Compilation
  73. The Fun's Not Over
  74. 8. Datatypes and Type Checking
  75. Datatypes and Type Annotations
  76. Untyped Variables,Parameters, Return Values, and Expressions
  77. Strict Mode's Three Special Cases
  78. Warnings for Missing Type Annotations
  79. Detecting Reference Errors at Compile Time
  80. Casting
  81. Conversion to Primitive Types
  82. Default Variable Values
  83. null and undefined
  84. Datatypes in the Virtual Zoo
  85. More Datatype Study Coming Up
  86. 9. Interfaces
  87. The Case for Interfaces
  88. Interfaces and Multidatatype Classes
  89. Interface Syntax and Use
  90. Another Multiple-Type Example
  91. More Essentials Coming
  92. 10. Statements and Operators
  93. Statements
  94. Operators
  95. Up Next: Managing Lists of Information
  96. 11. Arrays
  97. What Is an Array?
  98. The Anatomy of an Array
  99. Creating Arrays
  100. Referencing Array Elements
  101. Determining the Size of an Array
  102. Adding Elements to an Array
  103. Removing Elements from an Array
  104. Checking the Contents of an Array with the toString() Method
  105. Multidimensional Arrays
  106. On to Events
  107. 12. Events and Event Handling
  108. ActionScript Event Basics
  109. Accessing the Target Object
  110. Accessing the Object That Registered the Listener
  111. Preventing Default Event Behavior
  112. Event Listener Priority
  113. Event Listeners and Memory Management
  114. Custom Events
  115. Type Weakness in ActionScript's Event Architecture
  116. Handling Events Across Security Boundaries
  117. What's Next?
  118. 13. Exceptions and Error Handling
  119. The Exception-Handling Cycle
  120. Handling Multiple Types of Exceptions
  121. Exception Bubbling
  122. The finally Block
  123. Nested Exceptions
  124. Control-Flow Changes in try/catch/finally
  125. Handling a Built-in Exception
  126. More Gritty Work Ahead
  127. 14. Garbage Collection
  128. Eligibility for Garbage Collection
  129. Incremental Mark and Sweep
  130. Disposing of Objects Intentionally
  131. Deactivating Objects
  132. Garbage Collection Demonstration
  133. On to ActionScript Backcountry
  134. 15. Dynamic ActionScript
  135. Dynamic Instance Variables
  136. Dynamically Adding New Behavior to an Instance
  137. Dynamic References to Variables and Methods
  138. Using Dynamic Instance Variables to Create Lookup Tables
  139. Using Functions to Create Objects
  140. Using Prototype Objects to Augment Classes
  141. The Prototype Chain
  142. Onward!
  143. 16. Scope
  144. Global Scope
  145. Class Scope
  146. Static Method Scope
  147. Instance Method Scope
  148. Function Scope
  149. Scope Summary
  150. The Internal Details
  151. Expanding the Scope Chain via the with Statement
  152. On to Namespaces
  153. 17. Namespaces
  154. Namespace Vocabulary
  155. ActionScript Namespaces
  156. Creating Namespaces
  157. Using a Namespace to Qualify Variable and Method Definitions
  158. Qualified Identifiers
  159. A Functional Namespace Example
  160. Namespace Accessibility
  161. Qualified-Identifier Visibility
  162. Comparing Qualified Identifiers
  163. Assigning and Passing Namespace Values
  164. Open Namespaces and the use namespace Directive
  165. Namespaces for Access-Control Modifiers
  166. Applied Namespace Examples
  167. Final Core Topics
  168. 18. XML and E4X
  169. Understanding XML Data as a Hierarchy
  170. Representing XML Data in E4X
  171. Creating XML Data with E4X
  172. Accessing XML Data
  173. Processing XML with for-each-in and for-in
  174. Accessing Descendants
  175. Filtering XML Data
  176. Traversing XML Trees
  177. Changing or Creating New XML Content
  178. Loading XML Data
  179. Working with XML Namespaces
  180. Converting XML and XMLList to a String
  181. Determining Equality in E4X
  182. More to Learn
  183. 19. Flash Player Security Restrictions
  184. What's Not in This Chapter
  185. The Local Realm,the Remote Realm, and Remote Regions
  186. Security-Sandbox-Types
  187. Security Generalizations Considered Harmful
  188. Restrictions on Loading Content,Accessing Content as Data,
  189. Cross-Scripting, and Loading Data
  190. Socket Security
  191. Example Security Scenarios
  192. Choosing a Local Security-Sandbox-Type
  193. Distributor Permissions (Policy Files)
  194. Creator Permissions (allowDomain())
  195. Import Loading
  196. Handling Security Violations
  197. Security Domains
  198. Two Common Security-Related Development Issues
  199. On to Part II!
  200. Part II. Display and Interactivity
  201. 20. The Display API and the Display List
  202. Display API Overview
  203. The Display List
  204. Containment Events
  205. Custom Graphical Classes
  206. Go with the Event Flow
  207. 21. Events and Display Hierarchies
  208. Hierarchical Event Dispatch
  209. Event Dispatch Phases
  210. Event Listeners and the Event Flow
  211. Using the Event Flow to Centralize Code
  212. Determining the Current Event Phase
  213. Distinguishing Events Targeted at an Object from Events Targeted at That
  214. Object's Descendants
  215. Stopping an Event Dispatch
  216. Event Priority and the Event Flow
  217. Display-Hierarchy Mutation and the Event Flow
  218. Custom Events and the Event Flow
  219. On to Input Events
  220. 22. Interactivity
  221. Mouse-Input Events
  222. Focus Events
  223. Keyboard-Input Events
  224. Text-Input Events
  225. Flash Player-Level Input Events
  226. From the Program to the Screen
  227. 23. Screen Updates
  228. Scheduled Screen Updates
  229. Post-Event Screen Updates
  230. Redraw Region
  231. Optimization with the Event.RENDER Event
  232. Let's Make It Move!
  233. 24. Programmatic Animation
  234. No Loops
  235. Animating with the ENTER_FRAME Event
  236. Animating with the TimerEvent.TIMER Event
  237. Choosing Between Timer and Event.ENTER_FRAME
  238. A Generalized Animator
  239. Velocity-Based Animation
  240. Moving On to Strokes 'n' Fills
  241. 25. Drawing with Vectors
  242. Graphics Class Overview
  243. Drawing Lines
  244. Drawing Curves
  245. Drawing Shapes
  246. Removing Vector Content
  247. Example: An Object-Oriented Shape Library
  248. From Lines to Pixels
  249. 26. Bitmap Programming
  250. The BitmapData and Bitmap Classes
  251. Pixel Color Values
  252. Creating a New Bitmap Image
  253. Loading an External Bitmap Image
  254. Examining a Bitmap
  255. Modifying a Bitmap
  256. Copying Graphics to a BitmapData Object
  257. Applying Filters and Effects
  258. Freeing Memory Used by Bitmaps
  259. Words, Words, Words
  260. 27. Text Display and Input
  261. Creating and Displaying Text
  262. Modifying a Text Field's Content
  263. Formatting Text Fields
  264. Fonts and Text Rendering
  265. Missing Fonts and Glyphs
  266. Determining Font Availability
  267. Determining Glyph Availability
  268. Embedded-Text Rendering
  269. Text Field Input
  270. Text Fields and the Flash Authoring Tool
  271. Loading...Please Wait
  272. 28. Loading External Display Assets
  273. Using Loader to Load Display Assets at Runtime
  274. Compile-Time Type-Checking for Runtime-Loaded Assets
  275. Accessing Assets in Multiframe .swf Files
  276. Instantiating a Runtime-Loaded Asset
  277. Using Socket to Load Display Assets at Runtime
  278. Removing Runtime Loaded .swf Assets
  279. Embedding Display Assets at CompileTime
  280. On to Part III
  281. Part III. Applied ActionScript Topics
  282. 29. ActionScript and the Flash Authoring Tool
  283. The Flash Document
  284. Timelines and Frames
  285. Timeline Scripting
  286. The Document Class
  287. Symbols and Instances
  288. Linked Classes for Movie Clip Symbols
  289. Accessing Manually Created Symbol Instances
  290. Accessing Manually Created Text
  291. Programmatic Timeline Control
  292. Instantiating Flash Authoring Symbols via ActionScript
  293. Instance Names for Programmatically Created Display Objects
  294. Linking Multiple Symbols to a Single Superclass
  295. The Composition-Based Alternative to Linked Classes
  296. Preloading Classes
  297. Up Next:Using the Flex Framework
  298. 30. A Minimal MXML Application
  299. The General Approach
  300. A Real UI Component Example
  301. Sharing with Your Friends
  302. 31. Distributing a Class Library
  303. Sharing Class Source Files
  304. Distributing a Class Library as a .swc File
  305. Distributing a Class Library as a .swf File
  306. But Is It Really Over?
  307. Appendix
  308. Index
书名:ActionScript 3.0 精髓(影印版)
作者:Colin Moock
原版书出版商:O'Reilly Media
Colin Moock
Colin Moock自1995年开始从事Web的研究、设计和开发工作。Colin在1997年之前任SoftQuad公司(HoTMetaL PRO的制造者)的站点管理员。他现在是ICE的Web工作者,他的大部分时间用在编写Web代码,在会议上发表讲话,以及为诸如Sony, Levi's,Nortel,Air Canada和Hewlett-Packard公司创建交互内容上。Colin为Flash开发者提供的出色的Flash作品和支持站点,使他在 Flash开发者群体中享有很高的声誉。Macromedia公司已经在官方的Web站点上正式承认他为Flash专家,并且委任他为Flash顾问委员会的成员之一。Colin是《The Flash 4 Bible》和《The Flash 5 Bible》的合作者。
Colin Moock是一位独立的ActionScript专家,自从1999年以来他闻名于世的书已经教育了许多Flash程序员。他是权威的《Essential ActionScript 2.0 (O誖eilly, 2004)》和《ActionScript for Flash MX: The Definitive Guide (O誖eilly, 2003, 2001)》的作者。Moock运营着网络上最悠久的Flash开发网站之一,并且是Unity的共同创作者,Unity是用于创建多用户应用程序的一个客户端/服务端(Client/Server)框架。
The animal on the cover of Essential ActionScript 3.0 is the coral snake (Micrurus
fulvius tenere). This highly dangerous snake is found in the southeastern states of
North America and can also be found in Mexico. It likes wet, humid, and thick
foliage-littered forests, but can be found in any environment.
The coral snake is recognized by its vibrant red, yellow, and black bands. These
colors ward off would-be attackers. On the head and tail are bands of black and
yellow; on the midsection are black, yellow, and red bands. The red bands are always
adjacent to the yellow bands. The average length of a snake is 24 inches, with a
maximum length of 47 inches. The coral snake is the only venomous snake in North
America to hatch its young from eggs.
Coral snakes have short, grooved, and hollow fangs located at the front of the
mouth. They feed on lizards and other snakes. Coral snakes bite their prey to inject
neurotoxic venom, which paralyzes the victim; however, unlike snakes of the viper
family, which use a stabbing method, when a coral snake bites its victim, it hangs on
for a long time to inject as much venom as possible. Coral snakes are seldom seen,
due to their habit of living underground, or in cracks and crevices, and their
nocturnal tendencies. Coral snakes usually do not bite humans unless handled. If a
human or pet is bitten, treatment should take place as soon as possible, since coral
snake bites are often fatal.