Thông tin tài liệu
www.it-ebooks.info
www.it-ebooks.info
ActionScript
®
3.0 Bible
www.it-ebooks.info
www.it-ebooks.info
ActionScript
®
3.0 Bible
Second Edition
Roger Braunstein
Wiley Publishing, Inc.
www.it-ebooks.info
ActionScript
®
3.0 Bible
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-52523-4
Manufactured in the United States of America
10987654321
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher,
or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should
be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201)
748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties
with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties,
including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended
by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation.
This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other
professional services. If professional assistance is required, the services of a competent professional person should be
sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organi-
zation or Web site is referred to in this work as a citation and/or a potential source of further information does not
mean that the author or the publisher endorses the information the organization or Web site may provide or rec-
ommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have
changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be avail-
able in electronic books.
Library of Congress Control Number: 2009943640
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or
its affiliates, in the United States and other countries, and may not be used without written permission. ActionScript
is a registered trademark of Adobe Systems Incorporated. All other trademarks are the property of their respective
owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book.
www.it-ebooks.info
About the Author
Roger Braunstein is a multidisciplinary programmer and the Chief Roger Officer of partlyhuman inc.,
an independent development and design shop in Brooklyn, NY. Roger is an author of the first edition
of ActionScript 3.0 Bible, and a short e-book, Introduction to Flex 2. Roger builds games, mobile apps,
interactive art, tools, web apps, and websites using any technology he can wrap his head around. In
just the past two years he’s built stuff for LEGO, MoMA, Tim Burton, Antony and the Johnsons, AOL,
HBO, Puma, General Mills, Sport Chalet, Pepsi, Coke, OMGPOP, the French Culinary Institute, and
more. Additionally, he keeps busy with a series of independent projects. When not in front of a com-
puter, Roger enjoys normal human activities such as biking, cooking, reading, traveling, taking photos,
roller-skating, and dancing to music made on GameBoys. He is perpetually too preoccupied to put
anything interesting on his site
http://partlyhuman.com/, but you can use it to get in touch
with him.
www.it-ebooks.info
www.it-ebooks.info
Credits
Acquisitions Editor
Scott Meyers
Project Editor
Brian MacDonald
Technical Editor
Caleb Johnston
Production Editor
Daniel Scribner
Copy Editor
Karen Gill
Editorial Director
Robyn B. Siesky
Editorial Manager
Mary Beth Wakefield
Marketing Manager
David Mayhew
Production Manager
Tim Tate
Vice President and Executive
Group Publisher
Richard Swadley
Vice President and Executive
Publisher
Barry Pruett
Associate Publisher
Jim Minatel
Project Coordinator, Cover
Lynsey Stanford
Proofreader
Nancy Bell
Indexer
Robert Swanson
Cover Image
Joyce Haughey
Cover Designer
Michael E. Trent
www.it-ebooks.info
www.it-ebooks.info
[...]... xli Part I: ActionScript 3.0 Language Basics 1 Chapter Chapter Chapter Chapter Chapter 1: 2: 3: 4: 5: Introducing ActionScript 3.0 3 ActionScript 3.0 Language Basics 15 Functions and Methods 39 Object Oriented Programming 51 Validating Your Program .103 Part II: Core ActionScript 3.0 Data Types ... Applications .911 Index .921 xii www.it-ebooks.info Introduction xli Part I: ActionScript 3.0 Language Basics 1 Chapter 1: Introducing ActionScript 3.0 3 What Is ActionScript 3.0? .3 Exploring the Flash Platform 4 A Programmer’s Perspective 5 Language .5 API ... 10 In Short .11 From ActionScript 2.0 to ActionScript 3.0 11 Display List 11 Runtime Errors 12 Runtime Data Types 12 Method Closures 12 Intrinsic Event Model 12 Regular Expressions 12 E4X 12 Summary 13 Chapter 2: ActionScript 3.0 Language Basics ... Functions 814 Interfacing with Pixel Bender Kernels 817 Loading the Bytecode 817 Running a Kernel in ActionScript 818 Manipulating a Kernel 819 A Basic Shader in ActionScript 820 An Effect Shader in ActionScript 821 Bending Other Data .826 Preparing Data for Pixel Bender .826 BitmapData ... Bitmaps, Vectors, and Bitmap Caching 298 More on Rendering 299 Summary 299 Chapter 15: Working in Three Dimensions 301 Introducing 3D in ActionScript 3.0 301 The 3D Coordinate System 303 3D in Flash Professional 304 Limitations of 3D Display Objects 304 Display Objects are Flat 305 A Viewport... Professional and Flash Builder 104 Debugging in Flash Professional 104 Debugging in Flash Builder 106 Fixing Errors 108 Summary 110 Part II: Core ActionScript 3.0 Data Types 111 Chapter 6: Text, Strings, and Characters 113 Working with String Literals .113 Using Escaped Characters 114 Converting to and from... Representing Numbers 126 Digital Representations of Numbers 126 Unsigned Integers 126 Signed Integers .127 Floating-Point Numbers 127 Using Numbers in ActionScript 128 Number .128 int 129 uint 129 Literals .130 Edge Cases 130 Not a Number 131 Infinity... Nested Data .189 XML as Objects 189 JSON 190 Summary 190 Chapter 11: XML and E4X 191 Getting Started with XML in ActionScript 191 XML References .191 E4X References 192 XML Literals .192 A Brief Introduction to E4X Operators and Syntax 194 Legacy XML Handling... Gathering Meta-Information about XML Nodes 213 Finding Node Types 213 Determining the Type of Content in a Node 214 Using Namespaces .215 Creating XML Namespaces in ActionScript .216 Using the Namespace Class 216 Using the Namespace Keyword .217 Making Namespaces Available .217 xix www.it-ebooks.info Contents Querying Namespaced... 257 Binary Concepts 257 Bit Math and Operators .260 Basic Arithmetic 260 Bit Shifting 260 Bitwise Logic .262 Binary Types in ActionScript 263 Using ByteArray 265 Creating a ByteArray 265 Writing Data 265 Reading Data .265 Compressing and Decompressing . else 30
switch 30
The Conditional Operator 31
Repeating Actions Using Loops 33
Using for Loops 33
Using for in and for each in 34
for in 34
for each in 34
Using. parents.
ix
www.it-ebooks.info
www.it-ebooks.info
Introduction xli
PartI :ActionScript3 .0LanguageBasics 1
Chapter 1: Introducing ActionScript 3. 0 3
Chapter 2: ActionScript 3. 0 Language Basics 15
Chapter 3: Functions
Ngày đăng: 18/02/2014, 19:20
Xem thêm: Tài liệu Actionscript 3.0 bible 2nd edition docx, Tài liệu Actionscript 3.0 bible 2nd edition docx, Part I: ActionScript 3.0 Language Basics, Chapter 2: ActionScript 3.0 Language Basics, Part II: Core ActionScript 3.0 Data Types