دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش: 1
نویسندگان: Colin Moock
سری: Essential
ISBN (شابک) : 9780596526948, 0596526946
ناشر: Adobe Dev Library
سال نشر: 2007
تعداد صفحات: 948
زبان: English
فرمت فایل : DJVU (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود)
حجم فایل: 6 مگابایت
در صورت تبدیل فایل کتاب Essential ActionScript 3.0 (Essential) به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب Essential ActionScript 3.0 (Essential) نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
من سعی می کنم به خودم AS3 یاد بدهم و قبلاً زبان کامپیوتر را مطالعه نکرده ام. این کتاب برای تعریف اینکه چه چیزی، چرا و چگونه AS در کنار هم قرار می گیرد تا به خوبی مورد استفاده قرار گیرد، بهترین است. من فلش دارم و فلکس ندارم. این به پر کردن شکافهای سؤالات چندین کتاب دیگر مربوط به Flash کمک میکند.
I am attempting to teach myself AS3 and I have no prior study of computer languages. This book is the best for defining what, why, and how AS is put together to good use. I have Flash, and I do not have Flex. It helps fill the gaps to the questions left by several other books that pertain to Flash.
Essential ActionScript 3.0 Table of Contents Foreword Preface Beginners Welcome Expert Guidance What’s In This Book What’s Not In This Book Authoring Tool Agnosticism ActionScript Overview The Core Language Flash Runtime Clients Runtime APIs Components The Flash File Format (SWF) ActionScript Development Tools This Book’s Example Files Using Code Examples Typographical Conventions How to Contact Us Safari® Enabled Acknowledgments Part I ActionScript from the Ground Up Core Concepts Tools for Writing ActionScript Code Flash Client Runtime Environments Compilation Just-In-Time Compilation Quick Review Classes and Objects Creating a Program Packages Defining a Class Access Control Modifiers for Classes Virtual Zoo Review Constructor Methods Creating Objects Literal Syntax Object Creation Example: Adding a Pet to the Zoo Variables and Values Local Variables Instance Variables Access-control modifiers for instance variables Constructor Parameters and Arguments Expressions Assigning One Variable’s Value to Another Copies and References An Instance Variable for Our Pet Instance Methods Access Control Modifiers for Instance Methods Method Parameters and Arguments Method Return Values Method Signatures Members and Properties Virtual Zoo Review Break Time! Conditionals and Loops Conditionals The if Statement An if statement with no else Chaining if statements The switch Statement Loops The while Statement Processing Lists with Loops Ending a Loop with the break Statement The do-while Statement The for Statement Boolean Logic Logical OR Logical AND Logical NOT Back to Classes and Objects Instance Methods Revisited Omitting the this Keyword Managing Parameter/Variable Name Conflicts Bound Methods Using Methods to Examine and Modify an Object’s State Get and Set Methods Handling an Unknown Number of Parameters Up Next: Class-Level Information and Behavior Static Variables and Static Methods Static Variables Constants Static Methods The Class Initializer Class Objects C++ and Java Terminology Comparison On to Functions Functions Package-Level Functions Global Functions Nested Functions Source-File-Level Functions Accessing Definitions from Within a Function Functions as Values Function Literal Syntax Recursive Functions Using Functions in the Virtual Zoo Program Back to Classes Inheritance A Primer on Inheritance Static Methods and Static Variables Not Inherited Overriding Instance Methods Invoking an Overridden Instance Method Constructor Methods in Subclasses Preventing Classes from Being Extended and Methods from Being Overridden Subclassing Built-in Classes The Theory of Inheritance Why Inheritance? Polymorphism and Dynamic Binding Inheritance Versus Composition Is-A, Has-A, and Uses-A When to use composition over inheritance Abstract Not Supported Using Inheritance in the Virtual Zoo Program Creating Types of Pet Food Preparing VirtualZoo for Onscreen Display Virtual Zoo Program Code It’s Runtime! Compiling and Running a Program Compiling with the Flash Authoring Tool Compiling with Flex Builder 2 Moving the Main Class to the Unnamed Package Compiling the Program Running the Program Compiling with mxmlc Compiler Restrictions The Compilation Process and the Classpath Strict-Mode Versus Standard-Mode Compilation Enabling Standard-Mode Compilation in Flex Builder 2 Enabling Standard-Mode Compilation in the Flash Authoring Tool The Fun’s Not Over Datatypes and Type Checking Datatypes and Type Annotations Compatible Types Detecting Type Mismatch Errors with Type Annotations Untyped Variables, Parameters, Return Values, and Expressions Strict Mode’s Three Special Cases Warnings for Missing Type Annotations Detecting Reference Errors at Compile Time Casting Avoiding Unwanted Type Mismatch Errors Upcasting and Downcasting Using the as Operator to Cast to Date and Array Conversion to Primitive Types Default Variable Values null and undefined Datatypes in the Virtual Zoo More Datatype Study Coming Up Interfaces The Case for Interfaces Interfaces and Multidatatype Classes Interface Syntax and Use Interface Naming Conventions Interface Inheritance Marker Interfaces Another Multiple-Type Example More Essentials Coming Statements and Operators Statements Operators Number of Operands Operator Precedence Operator Associativity Datatypes and Operators Operator Overview Up Next: Managing Lists of Information Arrays What Is an Array? The Anatomy of an Array Array Elements Array Element Indexing Array Size Creating Arrays Creating Arrays with Array Literals Creating Arrays with the new Operator Referencing Array Elements Retrieving an Element’s Value Setting an Element’s Value Determining the Size of an Array Adding Elements to an Array Adding New Elements Directly Adding New Elements with the length Variable Adding New Elements with Array Methods The push() method The unshift() method The splice() method The concat() method Removing Elements from an Array Removing Elements with the delete Operator Removing Elements with the length Variable Removing Elements with Array Methods The pop() method The shift() method The splice() method Checking the Contents of an Array with the toString() Method Multidimensional Arrays On to Events Events and Event Handling ActionScript Event Basics Registering an Event Listener for an Event Step 1: Determine the event type’s name Step 2: Determine the event object’s datatype Step 3: Create the event listener Step 4: Register for the event Step 5: Wait for the event to occur Two More Event Listener Registration Examples Unregistering an Event Listener for an Event Event Vocabulary Review Accessing the Target Object Accessing the Object That Registered the Listener Preventing Default Event Behavior Event Listener Priority Event Listeners and Memory Management Weak Listener References Custom Events A Custom “gameOver” Event A Custom “toggle” Event Preventing Default Behavior for Custom Events Type Weakness in ActionScript’s Event Architecture Handling Events Across Security Boundaries Module.swf Listener Registers with Main.swf Object Main.Swf Listener Receives Notification for an Event Targeted at a Module.swf Display Object An Alternative to allowDomain(): Shared Events What’s Next? Exceptions and Error Handling The Exception-Handling Cycle Handling Multiple Types of Exceptions Determining Exception Type Granularity Options 1 and 2: Using a single custom-exception type Option 3: Using configurable debugging messages Option 4: Multiple custom VirtualPetNameException subclasses Exception Bubbling Uncaught Exceptions The finally Block Nested Exceptions Control-Flow Changes in try/catch/finally Handling a Built-in Exception Error Events for Problem Conditions More Gritty Work Ahead Garbage Collection Eligibility for Garbage Collection Incremental Mark and Sweep Disposing of Objects Intentionally Deactivating Objects Garbage Collection Demonstration On to ActionScript Backcountry Dynamic ActionScript Dynamic Instance Variables Processing Dynamic Instance Variables with for-each-in and for-in Loops Dynamically Adding New Behavior to an Instance Dynamic References to Variables and Methods Using Dynamic Instance Variables to Create Lookup Tables Making Lookup Tables with Object Literals Using Functions to Create Objects Using Prototype Objects to Augment Classes The Prototype Chain Onward! Scope Global Scope Class Scope Static Method Scope Instance Method Scope Function Scope Scope Summary The Internal Details Expanding the Scope Chain via the with Statement On to Namespaces Namespaces Namespace Vocabulary ActionScript Namespaces Creating Namespaces Choosing the Namespace URI Defining the Namespace Explicit Versus Implicit URIs Namespace Terminology Review Using a Namespace to Qualify Variable and Method Definitions User-Defined Namespace Attributes in the Top-Level of a Class Only Qualified Identifiers Expanded Names A Functional Namespace Example Namespace Accessibility Accessibility of Package-Level Namespace Definitions Accessibility of Class-Level Namespace Definitions Accessibility of Function-Level Namespace Definitions Qualified-Identifier Visibility Comparing Qualified Identifiers Assigning and Passing Namespace Values Assigning a Namespace Value to a Variable Namespaces as Method Arguments and Return Values A Namespace Value Example Open Namespaces and the use namespace Directive Open Namespaces and Scope Opening Multiple Namespaces Namespaces for Access-Control Modifiers Import Opens Public Namespaces Applied Namespace Examples Example: Framework-Internal Visibility Example: Permission-Based Access Control Example: Program Modes Final Core Topics XML and E4X Understanding XML Data as a Hierarchy Representing XML Data in E4X Creating XML Data with E4X Accessing XML Data Accessing the Root XML Node Accessing Child Nodes Accessing Text Nodes Accessing Parent Nodes Accessing Sibling Nodes Accessing Attributes Accessing Comments and Processing Instructions Accessing Attributes and Elements Whose Names Contain Reserved Characters Treating XMLList as XML, Revisited Processing XML with for-each-in and for-in Accessing Descendants Filtering XML Data Traversing XML Trees Changing or Creating New XML Content Changing the Contents of an Element Changing an Attribute Value Replacing an Entire Element Adding New Attributes and Elements Adding a new child after all existing children Adding a new child after a specific existing child Adding a new child before a specific existing child Adding a new child before all existing children Deleting Elements and Attributes References to Parts of a Document Are Not Live Using XML Entities for Special Characters Assigning Values to an XMLList Loading XML Data Working with XML Namespaces Accessing Namespace-Qualified Elements and Attributes Creating Namespace-Qualified Elements and Attributes Converting XML and XMLList to a String Converting XMLList to a String Converting an XML Element to a String Converting an Attribute to a String Converting Comments and Processing-Instructions to Strings Determining Equality in E4X XML Equality XMLList Equality QName Equality Namespace Equality More to Learn Flash Player Security Restrictions What’s Not in This Chapter The Local Realm, the Remote Realm, and Remote Regions Security-Sandbox-Types How Security-Sandbox-Types Are Assigned Security Generalizations Considered Harmful Restrictions on Loading Content, Accessing Content as Data, Cross-Scripting, and Loading Data Loading Content Accessing Content as Data Cross-Scripting Loading Data Restrictions on Loading Content, Accessing Content as Data, Loading Data, and Cross-Scripting Socket Security Example Security Scenarios Snoopy Email Attachment—Without Flash Player Security Snoopy Email Attachment—With Flash Player Security Internal Corporate Information—Without Flash Player Security Internal Corporate Information—With Flash Player Security Cross-Web Site Information—Without Flash Player Security Cross-Web Site Information—With Flash Player Security Choosing a Local Security-Sandbox-Type Compiling a Local-with-Filesystem .swf File Compiling a Local-with-Networking .swf File Granting Local Trust Developers Automatically Trusted Default Local Security-Sandbox-Type Distributor Permissions (Policy Files) Authorizing Loading-Data and Accessing-Content-as-Data Operations Creating the policy file Posting the policy file Obtaining a policy file’s permission to load data Obtaining a policy file’s permission to access content as data Using a Policy File to Authorize Socket Connections Create the policy file Socket-based policy-file retrieval HTTP-based policy-file retrieval Creator Permissions (allowDomain()) Allowing .swf Files Served Over HTTP to Cross-Script .swf Files Served Over HTTPS Import Loading Handling Security Violations Security Domains Ambiguous Use of the Term “Sandbox” Two Common Security-Related Development Issues Accessing Internet Subdomains Accessing the Loader Class’s Instance Variable Content On to Part II! Part II Display and Interactivity The Display API and the Display List Display API Overview Extending the Core-Display Class Hierarchy The Display List Containers and Depths Removing Assets from Containers Removing Assets from Memory Removing All Children Reparenting Assets Traversing Objects in a Display Hierarchy Manipulating Objects in Containers Collectively Descendant Access to a .swf File’s Main Class Instance The rebirth of _root Whither _level0? Containment Events The Event.ADDED and Event.REMOVED Events A Real-World Containment-Event Example The ADDED_TO_STAGE and REMOVED_FROM_STAGE Events Custom Event.ADDED_TO_STAGE and Event.REMOVED_FROM_STAGE events Custom Graphical Classes Go with the Event Flow Events and Display Hierarchies Hierarchical Event Dispatch Event Dispatch Phases Event Listeners and the Event Flow Registering an Ancestor Listener for the Capture Phase Registering an Ancestor Listener for the Bubbling Phase Registering an Ancestor Listener for Both the Capture Phase and the Bubbling Phase Registering a Listener with the Event Target The Dual Purpose of the useCapture Parameter Removing Event Listeners Using the Event Flow to Centralize Code Determining the Current Event Phase Distinguishing Events Targeted at an Object from Events Targeted at That Object’s Descendants Stopping an Event Dispatch Event Priority and the Event Flow Display-Hierarchy Mutation and the Event Flow Event Listener List Mutation Custom Events and the Event Flow On to Input Events Interactivity Mouse-Input Events Flash Player’s Built-in Mouse Events Registering for Mouse Events Mouse Events and Overlapping Display Objects Finding the Mouse Pointer’s Position Handling Mouse Events “Globally” Focus Events Focusing Objects Programmatically Focusing Objects with the Keyboard Focusing Objects with the Mouse Handling descendant focus through a single ancestor Flash Player’s Focus Events Keyboard-Input Events Global Keyboard-Event Handling Object-Specific Keyboard-Event Handling Determining the Most Recently Pressed or Released Key Multilocation keys Detecting Multiple Simultaneous Key Presses Mouse Events and Modifier Keys Determining the Character Associated with a Key Text-Input Events The TextEvent.TEXT_INPUT and Event.CHANGE Events The Event.SCROLL Event The TextEvent.LINK Event Flash Player-Level Input Events The Event.ACTIVATE and Event.DEACTIVATE Events The Event.RESIZE Event The Event.MOUSE_LEAVE Event From the Program to the Screen Screen Updates Scheduled Screen Updates No Screen Updates Within Code Blocks Setting the Frame Rate Designated Frame Rate Versus Actual Frame Rate Post-Event Screen Updates Post-Event Updates for Timer Events Automatic Post-Event Screen Updates Redraw Region Optimization with the Event.RENDER Event Let’s Make It Move! Programmatic Animation No Loops Animating with the ENTER_FRAME Event Frame Rate’s Effect on Event.ENTER_FRAME Animations Animating with the TimerEvent.TIMER Event Frame Rate’s Effect on Timer Choosing Between Timer and Event.ENTER_FRAME A Generalized Animator Velocity-Based Animation Moving On to Strokes ’n’ Fills Drawing with Vectors Graphics Class Overview Drawing Lines Drawing Curves Drawing Shapes Removing Vector Content Example: An Object-Oriented Shape Library From Lines to Pixels Bitmap Programming The BitmapData and Bitmap Classes Pixel Color Values Creating a New Bitmap Image Loading an External Bitmap Image Examining a Bitmap getPixel32() Versus getPixel() Transparency’s Effect on Color-Value Retrieval ColorPicker: A getPixel32() Example Retrieving the Color of a Region of Pixels Other Examination Tools Modifying a Bitmap Improve Performance with BitmapData.lock() ScribbleAS3: A setPixel32() Example Assigning the Color of a Region of Pixels Other Manipulation Tools Resizing a Bitmap Copying Graphics to a BitmapData Object The BitmapData Class’s Instance Method draw() How draw() handles Alpha channel values No arbitrary screen captures The BitmapData Class’s Instance Method copyPixels() Applying Filters and Effects Applying Filters Freeing Memory Used by Bitmaps Words, Words, Words Text Display and Input Creating and Displaying Text Word Wrapping Automatic Resizing Rotated, Skewed, and Transparent Text Requires Embedded Fonts Modifying a Text Field’s Content Formatting Text Fields Formatting Text with the TextFormat Class Available TextFormat variables Embedded font warning: Bold and italic require separate fonts setTextFormat() does not apply to future text assignments Applying paragraph-level formatting Retrieving formatting information for a span of characters Default formatting for text fields Formatting Text with HTML Entity support Quoting attribute values Interactions between the text and htmlText variables Unrecognized tags and attributes Formatting Text with the StyleSheet Class Notable style sheet limitations in ActionScript Formatting text with a programmatically created style sheet Class selectors Formatting XML tags with CSS Formatting text with an externally loaded style sheet Fonts and Text Rendering Embedding Font Outlines in the Flash Authoring Tool Embedding Font Outlines in Flex Builder 2 and mxmlc Formatting Text with an Embedded Font Using bold and italic with embedded fonts Loading Fonts at Runtime Missing Fonts and Glyphs Determining Font Availability Determining Glyph Availability Embedded-Text Rendering Tweaking the FlashType Renderer Text Field Input Text Entry Formatting user input Text Selection Hypertext Links Text Fields and the Flash Authoring Tool Loading...Please Wait... Loading External Display Assets Using Loader to Load Display Assets at Runtime Creating the Loader Instance Specifying the Asset’s Location Starting the Load Operation Accessing the Loaded Asset Displaying the Loaded Asset On Screen Displaying Load Progress Why not use Event.OPEN? Handling Load Errors Environment-specific behavior for load failures Debugging with HTTPStatusEvent Compile-Time Type-Checking for Runtime-Loaded Assets Opting Out of Compile-Time Type-Checking Give the Compiler Access to the Loaded Class Add the Module Class File to Main.swf’s source-path Add the Module Class File to Main.swf’s library-path Add the Module Class File to Main.swf’s external-library-path Accessing Assets in Multiframe .swf Files Instantiating a Runtime-Loaded Asset Instantiating a Loaded .swf File Instantiating a Loaded Image Using Socket to Load Display Assets at Runtime Server-Side: Sending the Asset Client-Side: Receiving the Asset Creating and connecting to the socket Placing bytes in a buffer Creating a display asset from the loaded bytes Removing Runtime Loaded .swf Assets Embedding Display Assets at CompileTime A Note on File Size and Memory Consumption General [Embed] Syntax Supported Asset Types Embedding Bitmap Images Embedding SVG Embedding Entire .swf Files Embedding Symbols from Legacy .swf Files Embedding Files as Binary Data Using getDefinition() to Access a Class in an Embedded .swf File An [Embed] Example Clean the Project to See Changes On to Part III Part III Applied ActionScript Topics ActionScript and the Flash Authoring Tool The Flash Document Timelines and Frames Keyframes and Regular Frames Timeline Scripting The Document Class Variable and Function Definitions in Frame Scripts Symbols and Instances Types of Symbols Movie Clip Symbols Linked Classes for Movie Clip Symbols Accessing Manually Created Symbol Instances Instance Names Matching Variables for Instance Names Accessing Manually Created Text Programmatic Timeline Control Instantiating Flash Authoring Symbols via ActionScript Instance Names for Programmatically Created Display Objects Linking Multiple Symbols to a Single Superclass The Composition-Based Alternative to Linked Classes Preloading Classes Up Next: Using the Flex Framework A Minimal MXML Application The General Approach Create the Flex Project Create the Application Point of Entry Trigger the Application Point of Entry A Real UI Component Example Sharing with Your Friends Distributing a Class Library Sharing Class Source Files Distributing a Class Library as a .swc File Creating a .swc-Based Class Library in Flex Builder 2 Using a .swc-Based Class Library in Flex Builder 2 Creating a .swc-Based Class Library in the Flash Authoring Tool Using a .swc-Based Class Library in the Flash Authoring Tool Distributing a Class Library as a .swf File Creating a .swf-Based Class Library in Flex Builder 2 Compiling a .swf file using mxmlc Using a .swf-Based Class Library in Flex Builder 2 Creating a .swf-Based Class Library in the Flash Authoring Tool Using a .swf-Based Class Library in Flash CS3 But Is It Really Over? The Final Virtual Zoo Index