Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780596805623/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Preface
Flex 4 is a powerful framework that provides enterprise-level components for the Flash Player platform in a markup language format recognizable to anyone with HTML or XML development experience. The Flex Framework provides components for visual layout, visual effects, data grids, server communication, charts, and much more.
To put a blunt point on it, the Flex Framework is massive, and any book attempting to cover the entire Framework in any depth will without question fail in some respect or another. With this in mind, weve made an attempt to cover the topics that most vex developers working with Flex 4. Along the way, well illuminate how the Framework is structured, as well as helping developers familiar with earlier versions of Flex to start working with the new components and styling functionality in Flex 4. The official Flex documentation is quite good at explaining in depth how particular methods or classes behave, so our focus instead is on how to tackle common tasks within the Flex Framework, how to get different components to work together, and how Flex can partner with other technologies to create Rich Internet Applications (RIA) and more. With the help of Adobe AIR, for example, you can use the tools of Flex and the Flash Player to create deployable desktop applications. This complements the expansion of open source and commercial tools for Java, .NET, and PHP development, among others, making Flex a powerful solution for an ever-wider range of development needs and challenges.
Who This Book Is For
Flex 4 Cookbook is for developers who want to understand the Flex Framework more thoroughly, who need a reference to consult to solve particular problems, or who are looking to understand new additions to the Flex Framework. As such, this book assumes that you have some previous experience with Flex and ActionScript 3. The code samples and explanations are geared toward intermediate developers familiar with the relationship between MXML and ActionScript, with at least some of the components that make up the Flex Framework, and with basic Flex development strategies.
We have made a very deliberate decision to ensure that all the recipes contain usable components and functional, tested implementations of those components. This was not done with the intention of swelling the book unreasonably, but to ensure that this book is suitable for intermediate and advanced developers who simply need to see a small code snippet to understand a technique, as well as readers who are still learning how the Flex Framework can be used and the best practices for working with it.
Who This Book Is Not For
If you need to learn the Flex Framework from scratch, consult Programming Flex 3 by Joey Lott and Chafic Kazoun (OReilly) or Hello! Flex by Peter Armstrong (Manning) to gain an understanding of the core concepts of Flex development before reading any further here. With a grounding in Flex and ActionScript basics, youll be better prepared to take advantage of the techniques in this book. If you need a refresher course in ActionScript development or are looking to learn techniques focused on core Flash ActionScript programming, try ActionScript 3.0 Cookbook by Joey Lott, Darron Schall, and Keith Peters (OReilly). Although Flex 4 Cookbook covers some areas of overlap between the Flex Framework and core Flash ActionScript classes, this book is very much focused on Flex development.
How This Book Is Organized
As its name implies, Flex 4 Cookbook is stuffed full with recipes intended to teach you techniques that will help you get more from your Flex applications. To help you find the solutions you need faster, the recipes are organized by theme. Generally, within each chapter, the recipes progress from simpler to more complex topics.
This book was not intended to be read from cover to cover, but rather to be used as a reference for particular problems, and to provide insight into particular aspects of the Flex Framework. The recipes also include complete component implementations to show you how to implement the concepts that are discussed. You should be able to use the demonstrated code in your own applications or, at the very minimum, adapt relevant portions of the code to your needs.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, filenames, and file extensions. Also used for emphasis.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, tags and components, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user. Also used for emphasis in code listings.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
Note
This icon signifies a tip, suggestion, or general note.
Warning
This icon indicates a warning or caution.
Using Code Examples
This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.