Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Flash Application Design Solutions
Nội dung xem thử
Mô tả chi tiết
Flash Application
Design Solutions
The Flash Usability Handbook
Ka Wai Cheung
Craig Bryant
5947FM.qxd 1/27/06 1:26 PM Page i
Flash Application Design Solutions:
The Flash Usability Handbook
Copyright © 2006 by Ka Wai Cheung and Craig Bryant
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-594-7
ISBN-10 (pbk): 1-59059-594-7
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
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
Chris Mills
Technical Reviewer
Paul Spitzer
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
Associate Publisher
Grace Wong
Project Manager
Beth Christmas
Copy Edit Manager
Nicole LeClerc
Copy Editors
Nicole LeClerc and Marilyn Smith
Assistant Production Director
Kari Brooks-Copony
Production Editor
Ellie Fountain
Compositor
Dina Quan
Proofreader
Dan Shaw
Indexer
Lucie Haskins
Artist
April Milne
Cover Designer
Kurt Krames
Manufacturing Director
Tom Debolski
5947FM.qxd 1/27/06 1:26 PM Page ii
DEDICATION
To Mom and Dad
— Ka Wai Cheung
To the fondest reader I’ve known, Peggy M. Bryant
— Craig Bryant
5947FM.qxd 1/27/06 1:26 PM Page iii
CONTENTS AT A GLANCE
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
PART ONE: INTRODUCING FLASH USABILITY
Chapter 1: Flash: Then, Now, Later . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 2: Setting Up Your Flash Environment . . . . . . . . . . . . . . 13
PART TWO: THE USABILITY SOLUTIONS
Chapter 3: A Basic Selection System . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 4: Navigation Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Chapter 5: Content Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Chapter 6: Inventory Views and Selection Devices . . . . . . . . . . . 109
iv
5947FM.qxd 1/27/06 1:26 PM Page iv
Chapter 7: Data Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Chapter 8: Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Chapter 9: State Management and Storage . . . . . . . . . . . . . . . . 197
Chapter 10: Help Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Chapter 11: Browser History . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Chapter 12: Liquid Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Chapter 13: Embedding Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
PART THREE: PUTTING THE PIECES TOGETHER
Chapter 14: Planning for Usability . . . . . . . . . . . . . . . . . . . . . . . . 285
Chapter 15: The Usable Bookstore . . . . . . . . . . . . . . . . . . . . . . . 299
Appendix: Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . 309
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
v
5947FM.qxd 1/27/06 1:26 PM Page v
CONTENTS
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
PART ONE: INTRODUCING FLASH USABILITY
Chapter 1: Flash: Then, Now, Later . . . . . . . . . . . . . . . . . . . . . . . . . 1
The brief, turbulent history of Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Flash MX 2004 and the release of ActionScript 2.0 . . . . . . . . . . . . . . . . . . . . . . . 3
New features introduced by ActionScript 2.0 . . . . . . . . . . . . . . . . . . . . . . . . 4
Usability benefits of ActionScript 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The advantages (and disadvantages) of Flash over HTML . . . . . . . . . . . . . . . . . . . 4
Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Cross-browser and cross-platform compliance . . . . . . . . . . . . . . . . . . . . . . . 6
Asynchronous processing and state management . . . . . . . . . . . . . . . . . . . . . 6
Robust design capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Flash vs. Ajax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Breaking the Flash usability stigma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Why Flash usability is important . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Current trends in web development . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Future developments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 2: Setting Up Your Flash Environment . . . . . . . . . . . . . . 13
Setting up the source directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Creating a classpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Applying a Flash library structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
vi
5947FM.qxd 1/27/06 1:26 PM Page vi
PART TWO: THE USABILITY SOLUTIONS
Chapter 3: A Basic Selection System . . . . . . . . . . . . . . . . . . . . . . . 19
Selection systems in HTML vs. Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Introducing the Flash selection system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Blueprinting the selection system solution . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Examining the base classes for the selection system . . . . . . . . . . . . . . . . . . . 24
The UIButton base class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The SelectionSystem base class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using and customizing the selection system . . . . . . . . . . . . . . . . . . . . . . . . 30
Creating the book item button clip . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Creating the book selection system movie clip . . . . . . . . . . . . . . . . . . . . 32
Adding the initialization code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Creating the BookItemButton class . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Creating the BookSelectionSystem class . . . . . . . . . . . . . . . . . . . . . . . . 37
Wrapping up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Chapter 4: Navigation Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Exploring the HTML menu conundrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
The simple text menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
The select box list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The customized drop-down menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Devising an optimal Flash menu solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Building the scrolling menu frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Creating the panel clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Creating the menu holder clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Creating the tab area assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
vii
5947FM.qxd 1/27/06 1:26 PM Page vii
Bringing the menu to life with ActionScript . . . . . . . . . . . . . . . . . . . . . . . . 51
Starting the ScrollingMenuFrame class . . . . . . . . . . . . . . . . . . . . . . . . 52
Setting the scrolling menu’s runtime events . . . . . . . . . . . . . . . . . . . . . 53
Enabling and disabling the menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Implementing the mouse watch methods . . . . . . . . . . . . . . . . . . . . . . . 56
Implementing the menu scrolling methods . . . . . . . . . . . . . . . . . . . . . . 56
Building the menu loading method . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Adjusting the menus’ appearance . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Putting the pieces together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Chapter 5: Content Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Understanding HTML’s inherent loading problem . . . . . . . . . . . . . . . . . . . . . . . 69
Developing a Flash loader solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
The design of loaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Ensuring accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Adding visual appeal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Allowing users to multitask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
General loader functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Commonly streamed objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
The Sound object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
The MovieClip object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The MovieClipLoader class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The XML object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
The LoadVars object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Creating a usable audio clip loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Laying out the loader features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Building the audio player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Adding the progress bar clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Adding the seeker clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Building the information display text fields . . . . . . . . . . . . . . . . . . . . . . 80
Adding the volume button clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Adding audio player buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Creating the time position indicator clip . . . . . . . . . . . . . . . . . . . . . . . 82
Using the Model-View design pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Building the loader model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Building the loader view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Putting it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
A note on the Model-View design implementation . . . . . . . . . . . . . . . . . . . . 96
Building a reusable movie clip loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Setting up the loader graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Coding the reusable loader clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Building the MovieClipLoaderUI class . . . . . . . . . . . . . . . . . . . . . . . . . 99
Defining MovieClipLoader’s event handlers . . . . . . . . . . . . . . . . . . . . . 100
Putting the loader clip to work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
CONTENTS
viii
5947FM.qxd 1/27/06 1:26 PM Page viii
A case study: A basic image gallery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Loading the thumbnails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Loading the full-size image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Chapter 6: Inventory Views and Selection Devices . . . . . . . . . . . 109
A brief interlude into metaphor-based design . . . . . . . . . . . . . . . . . . . . . . . . 110
Understanding the HTML shopping cart metaphor . . . . . . . . . . . . . . . . . . . . . 112
Devising a better shopping cart solution in Flash . . . . . . . . . . . . . . . . . . . . . . 115
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Creating the Flash UI assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
The cart layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
The product detail layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
The product grid layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
The thumbnail item clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
The draggable thumbnail item clip . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Coding the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Creating the grid layout structure . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Setting the position of the thumbnails . . . . . . . . . . . . . . . . . . . . . . . . 125
Creating the drag-and-drop functionality . . . . . . . . . . . . . . . . . . . . . . 126
Building the droppable UI areas . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Putting it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Chapter 7: Data Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Examining the limitations of standard searches . . . . . . . . . . . . . . . . . . . . . . . 140
Improving filtering with Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Storing data on the client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Using sliders to filter search criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Fading in and out inventory results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Reviewing the filtering enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Creating the Flash UI assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
The filtering slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
The product grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Building the filtering slider code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Building the DataFilterManager class . . . . . . . . . . . . . . . . . . . . . . . . . 150
Creating the DataFilterSlider class . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Using the EventDispatcher object . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Implementing the EventBroadcaster class . . . . . . . . . . . . . . . . . . . . . . 158
Modifying the ThumbItemButton class . . . . . . . . . . . . . . . . . . . . . . . . 159
Putting the pieces together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
CONTENTS
ix
5947FM.qxd 1/27/06 1:26 PM Page ix
Chapter 8: Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Humanizing forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Improving form validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
On-the-fly validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Unobtrusive error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Smarter validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Improving form workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Tabbing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Creating a better form experience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Self-scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Dynamic and smart validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Creating the Flash UI components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
The text input wrapper clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
The text area wrapper clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
The state combo box wrapper clip . . . . . . . . . . . . . . . . . . . . . . . . . . 173
The check box wrapper clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
The validation control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
The form container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Coding the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Building the form element wrapper code . . . . . . . . . . . . . . . . . . . . . . 177
Using a Strategy pattern to create reusable validation logic . . . . . . . . . . . . 180
Creating the validation strategy interface . . . . . . . . . . . . . . . . . . . . . . 182
Validating text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Validating a Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Validating a phone number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Validating a zip code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Creating the component wrapper subclasses . . . . . . . . . . . . . . . . . . . . 187
Building the validation control class . . . . . . . . . . . . . . . . . . . . . . . . . 188
Building the form container class . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Chapter 9: State Management and Storage . . . . . . . . . . . . . . . . 197
Remembering state in Flash applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Introducing the local shared object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Creating a local shared object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Customizing the location of the shared object . . . . . . . . . . . . . . . . . . . . . . 201
Reading and writing data from a local shared object . . . . . . . . . . . . . . . . . . 201
Building a skip intro feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Remembering visited links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Adding the history functionality to the code . . . . . . . . . . . . . . . . . . . . . . . 204
Adding a clear history function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
CONTENTS
x
5947FM.qxd 1/27/06 1:26 PM Page x
Chapter 10: Help Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Examining the limitations of the HTML title text solution . . . . . . . . . . . . . . . . . . 210
Improving help tips with Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Toggle feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Mobility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Fade in/snap out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Creating the movie clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The help tip clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The toggle clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Building the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Building the help tip clip class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Building the HelpTipManager class . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Building the toggle functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Putting it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Some help tip usability guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Chapter 11: Browser History . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Reviewing the Flash back button issue . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Determining where to go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Creating a simple Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Understanding how browser histories work . . . . . . . . . . . . . . . . . . . . . . . 231
Tracking history and changing state . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Building the SWF file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Scripting the page watcher code . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Creating the page states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Coding the main HTML page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Coding the history HTML page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Enabling browser history in the Flash selection system solution . . . . . . . . . . . . . . 239
Deciding which page states to track . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Modifying the book selection system code . . . . . . . . . . . . . . . . . . . . . . . . 241
Adding the watch method in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Modifying the history and main pages . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Examining Flash’s named anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Chapter 12: Liquid Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Exploring the fixed-width vs. liquid-width layout dilemma . . . . . . . . . . . . . . . . . 248
Designing a usable liquid layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Building liquid layouts in HTML: The CSS problem . . . . . . . . . . . . . . . . . . . . . . 250
Using the Flash Stage object to create liquid layouts . . . . . . . . . . . . . . . . . . . . 251
Designing a liquid layout in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
CONTENTS
xi
5947FM.qxd 1/27/06 1:26 PM Page xi
0e197eab08414336a67d4228a6088055
Building the Flash solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Designing the UI components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
The content area movie clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
The header bar clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
The navigation items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Setting up component data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Delegating layout responsibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Building the content area class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Building the stage manager class . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Setting the size of the content areas . . . . . . . . . . . . . . . . . . . . . . . . . 263
Setting the positions of the content areas . . . . . . . . . . . . . . . . . . . . . . 264
Creating the resize event handler . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Modifying the navigation item positions . . . . . . . . . . . . . . . . . . . . . . . . . 265
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Chapter 13: Embedding Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Optimizing usability when embedding Flash movies . . . . . . . . . . . . . . . . . . . . . 272
Browser compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Flash sniffing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Choosing an embedding method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
The default Flash-generated HTML method . . . . . . . . . . . . . . . . . . . . . . . 274
The Flash Satay method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
The nested object method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
The Flash Player Detection Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
The FlashObject method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Using FlashObject with Express Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Writing the HTML code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Checking for the ExpressInstall component . . . . . . . . . . . . . . . . . . . . . . . 281
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
PART THREE: PUTTING THE PIECES TOGETHER
Chapter 14: Planning for Usability . . . . . . . . . . . . . . . . . . . . . . . . 285
Setting the bar for Flash usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
RIA usability: A new paradigm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
The usability team members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Preparing for development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Defining the application’s purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Creating an application map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Exploring interactions through interaction models . . . . . . . . . . . . . . . . . . . 292
Designing wireframes for the application states . . . . . . . . . . . . . . . . . . . . . 292
CONTENTS
xii
5947FM.qxd 1/27/06 1:26 PM Page xii
Usability testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
The phases of usability testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Concept/experience design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Screenshot design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Prototyping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Beta release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Public release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Testing materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Chapter 15: The Usable Bookstore . . . . . . . . . . . . . . . . . . . . . . . 299
Navigating through the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Arriving at the Book Shopper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Finding help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Selecting a category of books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Filtering the book catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Learning about books in a category . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Adding and modifying items in your cart . . . . . . . . . . . . . . . . . . . . . . . . . 304
Submitting your billing and shipping information . . . . . . . . . . . . . . . . . . . . 305
Synthesizing the usability solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Appendix: Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . 309
ActionScript 2.0 (and OOP) programming . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Usability design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Flash usability (historical) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Web resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
CONTENTS
xiii
5947FM.qxd 1/27/06 1:26 PM Page xiii
5947FM.qxd 1/27/06 1:26 PM Page xiv