APress - Object-Oriented ActionScript For Flash 8 (2006).pdf

(13465 KB) Pobierz
30369312 UNPDF
30369312.003.png
Object-Oriented
ActionScript for Flash 8
Peter Elst and Todd Yard
with Sas Jacobs and William Drol
30369312.004.png 30369312.005.png
Object-Oriented ActionScript for Flash 8
Copyright © 2006 by Peter Elst, Todd Yard, Sas Jacobs, and William Drol
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-59059-619-7
ISBN-10 (pbk): 1-59059-619-6
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the
trademark owner, with no intention of infringement of the trademark.
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com,
or visit www.springeronline.com.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley,
CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or
indirectly by the information contained in this work.
The source code for this book is freely available to readers at www.friendsofed.com in the
Downloads section.
Credits
Lead Editor
Chris Mills
Assistant Production Director
Kari Brooks-Copony
Technical Reviewers
Jared Tarbell,
Stephen Downs
Production Editor
Katie Stence
Compositor
Dina Quan
Editorial Board
Steve Anglin, Dan Appleman,
Ewan Buckingham, Gary Cornell,
Jason Gilmore, Jonathan Hassell,
James Huddleston, Chris Mills,
Matthew Moodie, Dominic Shakeshaft,
Jim Sumser, Matt Wade
Proofreader
April Eddy
Indexer
Michael Brinkman
Project Manager
Sofia Marchant
Artist
April Milne
Copy Edit Manager
Nicole LeClerc
Interior and Cover Designer
Kurt Krames
Copy Editor
Ami Knox
Manufacturing Director
Tom Debolski
30369312.006.png
Dedicated to everyone at Macromedia, now Adobe, for their years
of unceasing commitment to the Flash community.
—Peter Elst
Dedicated to my wife, Lydian, who loves me despite the fact that after
all the hours I spent on this book she only gets this sentence.
—Todd Yard
30369312.001.png
CONTENTS AT A GLANCE
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
PART ONE: OOP AND ACTIONSCRIPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Chapter 1: Introduction to OOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2: Programming Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 3: ActionScript 2.0 Programming . . . . . . . . . . . . . . . . . . . . . . . . . 19
PART TWO: FLASH OOP GUIDELINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Chapter 4: Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 5: Project Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Chapter 6: Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
PART THREE: CORE OOP CONCEPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 7: Encapsulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Chapter 8: Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
iv
30369312.002.png
Zgłoś jeśli naruszono regulamin