Example: air traffic controller

Programming ActionScript 3 - Joseph DeVore

Programming ActionScript Flex 2 2006 Adobe Systems Incorporated. All rights 2 Programming ActionScript this guide is distributed with software that includes an end-user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end-user license content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated.

Flex 2 Programming ActionScript 3.0 If this guide is distributed with software that includes an end-user agreement, this guide, as well as the software described i n it, is furnished under license and may be used or copied only in accordan ce with the terms of such license.

Tags:

  Programming, Actionscript, Programming actionscript 3

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Programming ActionScript 3 - Joseph DeVore

1 Programming ActionScript Flex 2 2006 Adobe Systems Incorporated. All rights 2 Programming ActionScript this guide is distributed with software that includes an end-user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end-user license content of this guide is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated.

2 Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies that may appear in the informational content contained in this remember that existing artwork or images that you may want to include in your project may be protected under copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of the copyright owner. Please be sure to obtain any permission required from the copyright references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual , the Adobe logo, Flex, Flex Builder and Flash Player are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. ActiveX and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries.

3 Macintosh is a trademark of Apple Computer, Inc., registered in the United States and other countries. All other trademarks are the property of their respective owners. Speech compression and decompression technology licensed from Nellymoser, Inc. ( ).Sorenson Spark video compression and decompression technology licensed from Sorenson Media, browser Copyright 1995-2002 Opera Software ASA and its suppliers. All rights Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USAN otice to government end users. The software and documentation are Commercial Items, as that term is defined at 48 , consisting of Commercial Computer Software and Commercial Computer Software Documentation, as such terms are used in 48 or 48 , as applicable. Consistent with 48 or 48 through , as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to Government end users (a) only as Commercial items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein.

4 Unpublished-rights reserved under the copyright laws of the United States. Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 through 60-60, 60-250 ,and 60-741. The affirmative action clause and regulations contained in the preceding sentence shall be incorporated by 1: OVERVIEW OF ActionScript PROGRAMMINGA bout This Manual ..11 Using this manual .. 12 Accessing ActionScript documentation .. 13 Developer Center .. 14 Chapter 1: Introduction to ActionScript .

5 15 About ActionScript .. 15 Advantages of ActionScript .. 16 What s new in ActionScript .. 16 Compatibility with previous versions .. 20 Chapter 2: Getting Started with ActionScript .. 23 The basic ActionScript development process .. 23 Options for organizing your code .. 24 Example: Creating a basic application .. 26 Chapter 3: ActionScript Language and Syntax .. 35 Language overview .. 35 Objects and classes ..37 Packages and namespaces .. 38 Variables .. 51 Data types .. 55 Syntax .. 71 Operators .. 77 Conditionals .. 85 Looping.. 88 Functions .. 91 Chapter 4: Object-Oriented Programming in ActionScript .. 107 Classes .. 107 Interfaces .. 126 Inheritance ..1304 ContentsAdvanced topics .. 139 Example: GeometricShapes .. 148 Chapter 5: Display Programming .. 159 Understanding the display architecture .. 160 Working with display objects.

6 167 Basics for working with the core display classes .. 176 Example: SpriteArranger .. 187 PART 2: CORE ActionScript DATA TYPES AND CLASS-ESChapter 6: Working with Dates and Times .. 197 Managing calendar dates and times .. 197 Controlling time intervals .. 201 Example: Simple analog clock .. 204 Chapter 7: Working with Strings .. 209 Creating strings .. 209 The length property .. 211 Working with characters in strings .. 211 Comparing strings .. 212 Obtaining string representations of other objects .. 213 Concatenating strings.. 213 Finding substrings and patterns in strings .. 214 Converting strings between uppercase and lowercase .. 219 Example: ASCII Art .. 220 Chapter 8: Working with Arrays .. 227 Indexed arrays .. 227 Associative arrays ..236 Multidimensional arrays .. 240 Cloning arrays..243 Advanced Topics ..243 Example: PlayList.

7 249 Chapter 9: Handling Errors .. 255 Types of errors ..256 Error handling in ActionScript ..258 Working with the debugger version of Flash Player .. 260 Contents5 Handling synchronous errors in an application .. 261 Creating custom error classes .. 266 Responding to error events and status .. 267 Comparing the Error classes .. 271 Example: CustomErrors application .. 277 Chapter 10: Using Regular Expressions .. 285 Introduction to Regular Expressions .. 286 Regular expression syntax .. 287 Methods for using regular expressions with strings .. 303 Example: A Wiki parser .. 304 Chapter 11: Working with XML .. 311A quick introduction to XML .. 312 The E4X approach to XML processing .. 313 XML objects ..315 XMLList objects .. 317 Initializing XML variables ..319 Assembling and transforming XML objects .. 320 Traversing XML structures.

8 322 Using XML namespaces .. 327 XML type conversion.. 328 Reading external XML documents .. 330 Example: Loading RSS data from the Internet .. 330 PART 3: FLASH PLAYER APISC hapter 12: Flash Player API Overview .. package .. package .. package .. package .. package.. package .. package.. package .. package .. package .. package .. package .. package .. package .. package .. package ..343 Chapter 13: Handling Events .. 345 Introduction to Event Handling ..346 How ActionScript event handling differs from earlier versions . 347 The event flow .. 350 Event objects ..352 Event listeners .. 357 Example: Alarm Clock ..365 Chapter 14: Networking and Communication .. 371 Working with external data .. 372 Connecting to other Flash Player instances .. 379 Socket connections ..385 Storing local data.. 390 Working with file upload and download.

9 394 Example: Building a Telnet client .. 404 Example: Uploading and downloading files .. 408 Chapter 15: Working with Geometry .. 417 Using Point objects .. 417 Using Rectangle objects .. 420 Using Matrix objects ..423 Example: Applying a matrix transformation to a display object ..428 Chapter 16: Client System Environment .. 433 System class..433 Capabilities class ..435 ApplicationDomain class ..436 IME class .. 439 Example: Detecting system capabilities .. 444 Chapter 17: Flash Player Security.. 449 Flash Player Security overview .. 450 Overview of permission controls .. 452 Security sandboxes.. 461 Restricting networking APIs .. 464 Full-screen mode security ..465 Contents7 Loading content .. 467 Cross-scripting .. 470 Accessing loaded media as data.. 474 Loading data .. 477 Loading embedded content from SWF files imported into a security do-main.

10 479 Working with legacy content .. 480 Setting LocalConnection permissions..481 Controlling access to scripts in a host web page..481 Shared objects .. 483 Camera, microphone, Clipboard, mouse, and keyboard access .. 484 Chapter 18: Printing .. 487 What s new for the PrintJob class using ActionScript .. 488 Printing a page .. 488 Flash Player tasks and system printing .. 489 Setting size, scale, and orientation .. 493 Example: Multiple-page printing .. 495 Example: Scaling, cropping, and responding.. 498 Chapter 19: Using the External API.. 501 About the External API .. 502 Using the ExternalInterface class .. 503 Example: Using the External API with a web page container .. 507 Example: Using the External API with an ActiveX container ..5148 Contents91 PART 1 Overview of ActionScript ProgrammingThis part describes fundamental Programming concepts in ActionScript following chapters are included:About This Manual.


Related search queries