AdvancED ActionScript 3.0: Design Patterns
Copyright 2011 by Ben Smith
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-4302-3614-6
SBN-13 (electronic): 978-1-4302-3616-0
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logos, or image, we use the names, logos, or images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
Distributed to the book trade worldwide by Springer Science+Business Media LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail .
For information on translations, please e-mail .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk SaleseBook Licensing web page at www.apress.com/bulk-sales
.
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
President and Publisher: Paul Manning | Copy Editor: Tiffany Taylor and Mary Behr |
Lead Editor: Ben Renow-Clarke | Compositor: Bronkella Publishing |
Technical Reviewers: Koen De Weggheleire and Peter Elst | Indexer: BIM Indexing & Proofreading Services |
Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh | Artist: SPI Global Cover Image Artist: Corn van Dooren Cover Designer: Anna Ishchenko |
Coordinating Editor: Anita Castro |
In loving memory of my cat Buttercup, who passed during the writing of this book.
To my wife, for her tolerance of the late evenings as well as for her constant encouragementI thank you always.
Ben Smith
Contents at a Glance
Contents
About the Author
Ben Smith is an accomplished Flash developer with years of experience creating advanced rich Internet applications (RIAs) for well-known digital agencies. He is an Adobe Community Professional and has contributed articles to both InsideRIA and the Adobe developer community. Ben began his career in Connecticut and spent several years working in New York and Florida. Ben is currently back in New York where he both works and resides. He is passionate about higher learning, which he believes comes from experimentation and experience. With more than 10,000 hours of experience with Flash, he does not consider himself a master of Flash, but a student of what Flash requires him to know.
About the Technical Reviewer
Koen De Weggheleire is a faculty member of the Technical University of West-Flanders in Belgium (HOWEST) where he teaches multiscreen Flash Platform Solutions (Flash, Flex, AIR) with a smile. As Adobe Community Professional for the Flash Platform, Koen is heavily addicted to the community and inspires the community by his blog at www.newmovieclip.com/
and by speaking at several (inter)national industry events (Adobe MAX, FITC, 360 Flex, Flashbelt, Flash On The Beach, Flash on Tap). He coordinates the yearly Belgian multimedia conference Multi-Mania (www.multi-mania.be/
) where 2,000 people from around the world come together to learn from industry experts and to share knowledge. Koen also is co-author of Foundation Flex for Developers (friends of Ed, 2007), Flash CS4 AIR Development (friends of ED, 2009) and the Adobe AIR Cookbook (O'Reilly, 2009).
When he's not doing any of the above activities, you can find Koen at his company HappyBanana, together with Wouter Verweirder, doing Flash Platform consultancy on advanced, award-winning, rich multiscreen applications. When Koen is not talking ActionScript, you can find him producing music, collecting goodies, eating pizza, or renovating his 100 year old house.
About the Cover Image Artist
Corn van Dooren designed the front cover image for this book. After taking a brief hiatus from friends of ED to create a new design for the Foundation series, he worked at combining technological and organic forms, the results of which now appear on this and other book covers.
Corn spent his childhood drawing on everything at hand and then began exploring the infinite world of multimediaand his journey of discovery hasn't stopped since. His mantra has always been, The only limit to multimedia is the imaginationa saying that keeps him constantly moving forward.
Corn works for many international clients, writes features for multimedia magazines, reviews and tests software, authors multimedia studies, and works on many other friends of ED books. You can see more of his work at and contact him through his website at www.cornevandooren.com
.
Acknowledgments
I'm happy to acknowledge the work of Professor Trygve Reenskaug for his conception of the Model View Controller. A friend and pioneer of design patterns, I thank you for your wisdom.
Introduction
Design patterns are an abstract concept and a subject that involves being vague to help solve problems. This is somewhat ambiguous and makes design patterns a difficult topic. Fortunately, a difficult subject does not necessarily mean one that is complicated in its understanding. This will be evident in AdvancED ActionScript 3.0: Design Patterns.
This book requires prerequisite knowledge of ActionScript and Object Oriented Programming, but it demonstrates the hand-in-hand relationship of OOP and design patterns. The beginning chapters of this book discuss and detail OOP principles, and while some aspects may be review, all will be preparation for upcoming chapters. Each chapter will prepare you for the next. Until round out the book by covering the use of combining patterns and discuss how to remain object-oriented in a fast-paced industry.