Flash Applica Tions Mobile Devices
Total Page:16
File Type:pdf, Size:1020Kb
Leggett de Boer Janousek Foundation FOUNDATION Flash Applications FOR FLASH APPLICATIONS for Mobile Devices In this book you’ll learn: Also Available The essentials of Flash Lite 1.1 and 2.X How to create mobile applications and games MOBILE DEVICES Best practices for structuring your mobile applications, from starting out Richard Leggett to final deployment Weyert de Boer How to integrate graphics, sound, and video into your mobile content How to consume live data over HTTP and socket connections and make Scott Janousek use of phone-specific features Foundation Flash Applications for Mobile Devices ith a growing number of mobile devices offering Flash support, Wit is an increasingly viable platform for the development of mobile applications. Foundation Flash for Mobile Devices is just the book you need to learn how to take advantage of this new audience of mobile application users. Inside, it covers every facet of mobile Flash, from the essentials of the Flash Lite 1.1 and 2.X platforms and writing applications to testing your work and deploying to mobile users. Applications presented include screensavers, wallpapers, data-consuming informational programs (such as movie, news, and stock tickers), quiz games, action games, and more. You are given tips on mobile Flash development best practices, and all of the essential topics are covered, including creating and using sound, vector graphics, and bitmaps; optimizing assets for the small screen; coding realistic physics for games; and consuming web services using PHP, Java™, ColdFusion, and .NET. Throughout the book, there are many samples to put together and learn from, and several bonus applications are also available to download and check out. SHELVING CATEGORY 1. FLASH ISBN 1-59059-558-0 Learn how to create and deploy mobile 90000 Flash applications and games Learn how to use the Flash Lite 1.1 and 2.X platforms Mac/PC compatible Covers integration of sound, video, 6 89253 59558 9 www.friendsofed.com 9 781590 595589 and other assets into your mobile Flash content this print for reference only—size & color not accurate 7.5" x 9" / Casebound / Malloy spine bulk = 0.000" 000 page count 50# Thor 5580FMCMP2 11/27/06 4:14 PM Page i Foundation Flash Applications for Mobile Devices Richard Leggett Weyert de Boer Scott Janousek 5580FMCMP2 11/27/06 4:14 PM Page ii Foundation Flash Applications for Mobile Devices Copyright © 2006 by Richard Leggett, Weyert de Boer, Scott Janousek 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: 978-1-59059-558-9 ISBN-10: 1-59059-558-0 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. Java™ and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book was written without endorsement from Sun Microsystems, Inc. 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 [email protected], 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 [email protected], 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 Production Editor Chris Mills Laura Esterman Technical Reviewers Compositor Marco Casario Diana Van Winkle Cesar Tardaguila Artist Editorial Board April Milne Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Proofreaders Jonathan Gennick, Jonathan Hassell, Liz Welch James Huddleston, Chris Mills, Lori Bring Matthew Moodie, Dominic Shakeshaft, Indexer Jim Sumser, Matt Wade Toma Mulligan Project Manager | Production Director Cover Image Designer Grace Wong Corné van Dooren Copy Edit Manager Interior and Cover Designer Nicole Flores Kurt Krames Copy Editors Manufacturing Director Heather Lang Tom Debolski Damon Larson Assistant Production Director Kari Brooks-Copony 5580FMCMP2 11/27/06 4:14 PM Page iii CONTENTS AT A GLANCE About the Authors . xv About the Main Technical Reviewer . xvii About the Cover Image Designer. xvii Acknowledgments . xix Introduction . xxi PART ONE GETTING STARTED. 1 Chapter 1 Macromedia and Adobe Flash: An Overview . 3 Chapter 2 Mobile Devices . 17 Chapter 3 Flash Lite 1.1 and Your First Flash Lite Application . 43 Chapter 4 Flash Lite 2.X . 97 PART TWO LET’S GET DEVELOPING!. 131 Chapter 5 Application Development . 133 Chapter 6 Mobile Gaming . 185 Chapter 7 Flash Lite Mobile Entertainment Basics . 225 Chapter 8 Flash Mobile Sound . 261 Chapter 9 Flash Mobile Video . 299 Chapter 10 Extending Flash Lite . 339 PART THREE THE POST-DEVELOPMENT STAGE . 389 Chapter 11 Distribution and Deployment . 391 Chapter 12 The Future of Flash in the Mobile World . 427 PART FOUR APPENDIXES . 439 Appendix A Error Codes . 441 Appendix B FSCommand2 Commands . 445 Appendix C Glossary of Terms . 467 Index . 483 iii 5580FMCMP2 11/27/06 4:14 PM Page iv 5580FMCMP2 11/27/06 4:14 PM Page v CONTENTS About the Authors . xv About the Main Technical Reviewer . xvii About the Cover Image Designer. xvii Acknowledgments . xix Introduction . xxi PART ONE GETTING STARTED. 1 Chapter 1 Macromedia and Adobe Flash: An Overview . 3 A brief history of Flash . 4 ActionScript . 6 Object-oriented programming . 7 ActionScript 2.0 . 7 ActionScript 3.0 . 7 Rich Internet Applications . 8 Peripheral Flash technologies . 9 Flash Remoting . 9 Flash Media Server . 10 Stand-alone SWF wrappers . 10 Flex and the Flash platform . 11 Alternatives to Flex and the Flash IDE . 11 Open source Flash . 12 Mobile Flash . 12 Flash for Pocket PC . 12 Flash Lite . 12 FlashCast . 13 The future . 13 Summary . 14 Chapter 2 Mobile Devices . 17 The wireless revolution . 18 Mobile evolution . 18 Content and infrastructure . 19 What is 3G? . 19 Cultural acceptance . 20 Synchronization and convergence . 20 v 5580FMCMP2 11/27/06 4:14 PM Page vi CONTENTS Invasive nature of personal devices . 21 A CRM dream . 22 Types of devices . 23 Mobile phones and their operating systems . 23 PDAs and their operating systems . 24 Other devices . 25 Device limitations . 27 CPU and RAM . 28 Screen size and resolution . 28 Screen color depth . 29 Keypads . 29 Other input devices . 30 Ergonomics . 30 Connectivity and network speeds . ..