As a professional enterprise software developer with over 10 years in the biz, I've accumulated a large-ish library of technical books which I have read cover-to-cover. "Flex Solutions" is easily the worst of the lot. I have only made it through chapter two and have already encountered so many code errors, wretchedly banal examples, and chunks of confusing and poorly worded grammar that I am moving on to a different book. There is a website which lists some of the Errata, but even the extensive list for chapter one is incomplete. I don't expect all technology books to be as readable and effective as Horstmann's "Core Java", or be as thorough as the painfully complete "Java Persistance with Hibernate", but a technical manual should at least aspire to accuracy and clarity. On both counts, "Flex Solutions" fails miserably. PRELIMS......Page 1 CONTENTS AT A GLANCE......Page 7 CONTENTS......Page 9 ABOUT THE AUTHOR......Page 21 ABOUT THE TECHNICAL REVIEWER......Page 23 ACKNOWLEDGMENTS......Page 25 INTRODUCTION......Page 27 What you need......Page 29 Questions and contacts......Page 30 Layout conventions......Page 31 FLEX BASICS......Page 35 What’s involved......Page 36 How to build it......Page 37 Expert tips......Page 40 How to build it......Page 41 Solution 1-3: Extending Flex controls with ActionScript......Page 46 How to build it......Page 47 Expert tips......Page 53 What’s involved......Page 57 How to build it......Page 58 Expert tips......Page 61 Solution 1-5: Understanding the Flex event model......Page 62 What’s involved......Page 63 How to build it......Page 64 Expert tips......Page 67 How to build it......Page 68 Expert tips......Page 71 What's involved......Page 72 How to build it......Page 73 Expert tips......Page 77 How to build it......Page 79 What’s involved......Page 82 How to build it 1......Page 83 Expert tips......Page 85 Summary......Page 86 USING FLEX COMPONENTS......Page 89 Solution 2-1: Creating and invoking MXML components......Page 90 How to build it......Page 91 Expert tips......Page 94 What’s involved......Page 95 How to build it......Page 96 Expert tips......Page 100 What’s involved......Page 101 How to build it......Page 102 Expert tips......Page 106 Solution 2-4: Managing multiple packages for components......Page 108 How to build it......Page 109 Expert tips......Page 111 How to build it......Page 112 Solution 2-6: Creating composite components......Page 116 How to build it......Page 117 Expert tips......Page 122 What’s involved......Page 123 How to build it......Page 124 Expert tips......Page 127 What’s involved......Page 128 How to build it......Page 129 Expert tips......Page 136 How to build it......Page 137 Expert tips......Page 140 Solution 2-10: Creating reusable components using template components......Page 141 How to build it......Page 142 Expert tips......Page 146 Summary......Page 147 WORKING WITH DATA MODELS AND THE VALUE OBJECT......Page 149 What’s involved......Page 150 How to build it......Page 151 Expert tips......Page 156 How to build it......Page 157 Expert tips......Page 159 Solution 3-3: ActionScript classes as data models......Page 160 What’s involved......Page 161 How to build it......Page 163 Expert tips......Page 167 Solution 3-4: Using data binding with data models......Page 168 How to build it......Page 169 Expert tips......Page 173 Solution 3-5: Converting an MXML data model into an ActionScript object......Page 174 What’s involved......Page 175 How to build it......Page 176 Expert tips......Page 178 Summary......Page 181 VALIDATING AND FORMATTING DATA......Page 183 Solution 4-1: MXML validator classes......Page 184 How to build it......Page 185 What’s involved......Page 187 How to build it......Page 188 Expert tips......Page 189 Solution 4-3: Customizing error messages in Validator classes......Page 190 How to build it......Page 191 Solution 4-4: Validating data using ActionScript 3.0......Page 194 How to build it......Page 195 Expert tips......Page 198 What’s involved......Page 199 How to build it......Page 200 Expert tips......Page 205 Solution 4-6: Validating a data model using the validate() method......Page 206 What’s involved......Page 207 How to build it......Page 208 Expert tips......Page 211 Solution 4-7: Extending the RegExpValidator class......Page 213 How to build it......Page 214 Expert tips......Page 217 What’s involved......Page 219 How to build it......Page 220 Expert tips......Page 222 Solution 4-9: Formatting list-based controls with the labelFunction property......Page 223 What’s involved......Page 224 How to build it......Page 225 Expert tips......Page 226 Summary......Page 227 MANAGING COMPLEX DATA......Page 229 What’s involved......Page 231 How to build it......Page 232 Solution 5-2: Converting an MXML data model into an ArrayCollection......Page 235 What’s involved......Page 236 How to build it......Page 237 Expert tips......Page 238 Solution 5-3: Setting and getting items in an ArrayCollection......Page 239 What’s involved......Page 240 How to build it......Page 241 Solution 5-4: Filtering data......Page 246 What’s involved......Page 247 How to build it......Page 248 Expert tips......Page 251 What’s involved......Page 253 How to build it......Page 254 Expert tips......Page 258 What’s involved......Page 259 How to build it......Page 260 Expert tips......Page 263 What’s involved......Page 264 How to build it......Page 265 Expert tips......Page 266 Solution 5-8: Adding and removing data with the cursor......Page 267 How to build it......Page 268 Expert tips......Page 269 Summary......Page 270 WORKING WITH REMOTE DATA USING THE RPC CLASSES......Page 273 Solution 6-1: Using the HTTPService class......Page 275 What’s involved......Page 276 How to build it......Page 277 Solution 6-2: Handling result and fault events......Page 280 What’s involved......Page 282 How to build it......Page 284 Expert tips......Page 288 What’s involved......Page 289 How to build it......Page 290 Expert tips......Page 296 Solution 6-4: Using the E4X format with the resultFormat property......Page 299 What’s involved......Page 301 How to build it......Page 302 Expert tips......Page 304 Solution 6-5: Sending parameters to a PHP and a JSP file......Page 305 What’s involved......Page 306 How to build it......Page 307 Expert tips......Page 313 Solution 6-6: Consuming a web service......Page 314 What’s involved......Page 315 How to build it......Page 316 Expert tips......Page 321 Solution 6-7: Using the RemoteObject with ColdFusion Flash Remoting......Page 323 What’s involved......Page 324 How to build it......Page 325 Solution 6-8: Remote communication with the Flash Player URLLoader class......Page 332 How to build it......Page 333 Solution 6-9: Using the RemoteObject with AMFPHP......Page 336 What’s involved......Page 337 How to build it......Page 338 Summary......Page 343 DISPLAYING DATA WITH LIST-BASED COMPONENTS......Page 347 What’s involved......Page 349 How to build it......Page 351 Expert tips......Page 355 What’s involved......Page 356 How to build it......Page 357 Expert tips......Page 361 What’s involved......Page 362 How to build it......Page 364 Expert tips......Page 367 What’s involved......Page 372 How to build it......Page 374 Expert tips......Page 380 What’s involved......Page 381 How to build it......Page 382 Expert tips......Page 385 Solution 7-6: The TileList and HorizontalList components......Page 389 How to build it......Page 390 Expert tips......Page 392 What’s involved......Page 393 How to build it......Page 395 Expert tips......Page 396 What’s involved......Page 397 How to build it......Page 398 Solution 7-9: Using the AdvancedDataGrid with a Tree control......Page 402 What’s involved......Page 403 How to build it......Page 404 Expert tips......Page 409 Solution 7-10: Creating a custom column using item renderers......Page 412 What’s involved......Page 413 How to build it......Page 415 Expert tips......Page 420 What’s involved......Page 421 How to build it......Page 423 Expert tips......Page 427 Summary......Page 428 COMPILING AND DEPLOYING FLEX APPLICATIONS......Page 431 Solution 8-1: Using the mxmlc compiler......Page 434 What’s involved......Page 436 How to build it......Page 440 Expert tips......Page 442 What’s involved......Page 444 How to build it......Page 445 Expert tips......Page 448 Solution 8-3: Writing a custom dynamic wrapper......Page 449 What’s involved......Page 450 How to build it......Page 453 Player feature......Page 459 What’s involved......Page 460 How to build it......Page 462 Solution 8-5: Compiling Flex components......Page 465 How to build it......Page 466 Expert tips......Page 470 Solution 8-6: Using the fdb command-line debugger......Page 471 What’s involved......Page 472 How to build it......Page 473 Solution 8-7: Deploying Flex applications......Page 474 What’s involved......Page 475 How to build it......Page 476 Expert tips......Page 480 Summary......Page 481 DESIGNING AND PROGRAMMING THE LOOK AND FEEL OF FLEX APPLICATIONS......Page 483 Solution 9-1: Designing the layout of a Flex application......Page 484 What’s involved......Page 487 How to build it......Page 489 Solution 9-2: Designing a constraint-based layout......Page 499 What’s involved......Page 501 How to build it......Page 506 Expert tips......Page 510 Solution 9-3: Customizing Flex components using styles......Page 511 What’s involved......Page 512 How to build it......Page 520 Expert tips......Page 527 What’s involved......Page 529 How to build it......Page 531 Expert tips......Page 537 What’s involved......Page 539 How to build it......Page 543 Expert tips......Page 551 Solution 9-6: Customizing the style of rows and columns of an AdvancedDataGrid control......Page 552 What’s involved......Page 553 How to build it......Page 554 Expert tips......Page 558 Solution 9-7: Using and embedding fonts in Flex applications......Page 561 What’s involved......Page 562 How to build it......Page 564 Expert tips......Page 570 Solution 9-8: Importing Flash CS3 assets into Flex......Page 572 What’s involved......Page 573 How to build it......Page 575 Expert tips......Page 582 Summary......Page 584 FLEX SECURITY......Page 587 What’s involved......Page 589 How to build it......Page 591 Expert tips......Page 594 What’s involved......Page 596 How to build it......Page 597 Solution 10-3: Storing persistent data......Page 600 What’s involved......Page 601 How to build it......Page 603 Expert tips......Page 606 Solution 10-4: Mashup applications using the LocalConnection and the Yahoo! Maps API......Page 607 What’s involved......Page 609 How to build it......Page 610 Expert tips......Page 615 Solution 10-5: Creating a proxy server-side service for Flash Player cross-domain security......Page 616 How to build it......Page 617 Expert tips......Page 619 What’s involved......Page 622 How to build it......Page 624 Solution 10-7: Securing a Flex application using server-based authentication......Page 634 What’s involved......Page 635 How to build it......Page 636 Expert tips......Page 638 Summary......Page 639 ADVANCED FLEX BUILDER TECHNIQUES......Page 641 What’s involved......Page 642 How to build it......Page 643 Expert tips......Page 648 What’s involved......Page 650 How to build it......Page 653 Expert tips......Page 659 Solution 11-3: Customizing the look and feel of applications at runtime by loading CSS......Page 661 What’s involved......Page 662 How to build it......Page 663 Solution 11-4: Documenting the application with the ASDoc tool......Page 666 What’s involved......Page 667 How to build it......Page 668 Expert tips......Page 673 Solution 11-5: Improving the startup performance of a Flex application......Page 674 What’s involved......Page 675 How to build it......Page 676 Expert tips......Page 679 Solution 11-6: Building modular applications with modules......Page 680 What’s involved......Page 681 How to build it......Page 682 Expert tips......Page 686 Summary......Page 687 MORE FLEX FRAMEWORK LIBRARIES AND UTILITIES......Page 691 Solution 12-1: Displaying data in a chart......Page 692 What’s involved......Page 693 How to build it......Page 694 Expert tips......Page 701 Solution 12-2: Working with events and effects with chart components......Page 704 What’s involved......Page 705 How to build it......Page 706 Expert tips......Page 714 Solution 12-3: Adding video contents within Flex......Page 716 What’s involved......Page 717 How to build it......Page 719 Expert tips......Page 722 What’s involved......Page 723 How to build it......Page 725 Expert tips......Page 731 Solution 12-5: Debugging applications with the Logging framework......Page 733 How to build it......Page 735 Expert tips......Page 740 What’s involved......Page 741 How to build it......Page 743 Expert tips......Page 749 Summary......Page 750 USER NAVIGATION IN FLEX APPLICATIONS......Page 753 Solution 13-1: Moving through the application with Navigator containers......Page 754 What’s involved......Page 755 How to build it......Page 757 Expert tips......Page 761 Solution 13-2: Creating and removing pop-up windows......Page 762 What’s involved......Page 763 How to build it......Page 765 Expert tips......Page 768 What’s involved......Page 769 How to build it......Page 771 Expert tips......Page 776 Solution 13-4: States and transitions using MXML and ActionScript......Page 778 What’s involved......Page 779 How to build it......Page 783 Expert tips......Page 788 What’s involved......Page 793 How to build it......Page 795 Expert tips......Page 799 Summary......Page 800 MIGRATING FLEX APPLICATIONS ON THE DESKTOP WITH ADOBE AIR......Page 803 Solution 14-1: Exporting a Flex application for the desktop......Page 805 What’s involved......Page 806 How to build it......Page 809 Expert tips......Page 813 Solution 14-2: Customizing OS windows using the AIR Window API......Page 814 What’s involved......Page 815 How to build it......Page 816 Solution 14-3: Accessing the file system......Page 823 What’s involved......Page 824 How to build it......Page 825 Expert tips......Page 830 Solution 14-4: Reading and writing persistent data on local file system......Page 832 What’s involved......Page 833 How to build it......Page 834 Expert tips......Page 838 Solution 14-5: Embedding HTML pages into desktop applications......Page 840 How to build it......Page 841 Expert tips......Page 848 What’s involved......Page 849 How to build it......Page 850 Expert tips......Page 853 What’s involved......Page 854 How to build it......Page 855 Summary......Page 859 INDEX......Page 863
Flex is the quickest and most effective technology for the creation of Rich Internet Applications for the Web. Its extensive library of components and totally customizable framework, combined with the ubiquity of Flash Player, has guaranteed its success.
The ecosystem of products that rotate around Flex 2 and Flex 3 is really broad. Flex Builder, Flex SDK, and Charting Components are all essential parts of the technology that fit the different requirements of web development.
This enormous set of possibilities can easily lead to informationoverload for developers like you. There's just too much to learn and too many potential places to go when you hit a brick wall. Wouldn't it be nice to have a library of solutions to solve these problems quickly and easily?
This book provides just that, with more than 100 solutions to common problems in one handy volume.
Flex Solutions: Essential Techniques for Flex 2 and Flex 3 Developers faces problems and provides solutions that can be applied to any project, from the most simple to the most complex. The solutions range from customizing Flex components with ActionScript 3.0, using the data models and the ActionScript classes as Value objects, validating and formatting data, using RPC classes to access remote data, to optimizing data-exchange performance using AMF3.
Solutions are also provided for enhancing the security of Flex applications, and techniques are offered for optimizing the actual work environment by increasing the performance of Flex Builder, adding video content, and creating an AIR project to bring your web application onto the desktop.
If you want to learn about and start to develop rich Internet applications in a short time, being immediately productive and mastering the Flex development techniques, Flex Solutions: Essential Techniques for Flex 2 and 3 Developers is the book you need.
- Discover real-world solutions for everyday Flex development, saving hours of development time
- Learn how to customize and extend the Flex Components Model and design and program the look and feel of your Flex applications
- Learn best practices and tips from a Flex expert for structuring the architecture of Flex applications
- Use the Flex Remote Procedure Classes to connect to remote data with HTTPServices and the Java Platform, PHP, ColdFusion, WebServices, and RemoteObject
- UseFlex 3 features such as the AdvancedDataGrid component and the Charting Enhancements feature
- Port your rich Internet applications onto the desktop with Adobe AIR
What you’ll learn - Tips on using Flex components
- How to validate and format data
- How to manage complex data
- Filtering, sorting and using cursors on data with collection classes
- How to consume Web Services using RPC components
- How to display data using list-based controls
- How to effectively compile and deploy Flex applications
- How to customize the look and feel of your applications
- How to make your applications more secure
- How to become more efficient in using the Flex Builder IDE
- Unique tricks such as calculating memory usage, making your Flex application into an active desktop, and customizing states
- How to use the ColdFusion Extensions for Flex Builder
- How to interface your Flex applications with server-side code written in PHP, Java, Rails, and ColdFusion
- Working with Flex in enterprise enviroment using the Flex Data Services, Java Remote Object and AMFPHP
Who this book is for This book is for any Flex 2 or Flex 3 developer who is comfortable with the basics and wants to take their knowledge further with quick fire solutions to common problems. Please note that some of the solutions contained in this book require the Flex Builder 3 Professional release of the software.
Flex is the quickest and most effective technology for the creation of Rich Internet Applications for the Web. Its extensive library of components and totally customizable framework, combined with the ubiquity of Flash Player, has guaranteed its success. The ecosystem of products that rotate around Flex 2 and Flex 3 is really broad. Flex Builder, Flex SDK, and Charting Components are all essential parts of the technology that fit the different requirements of web development. This enormous set of possibilities can easily lead to information overload for developers like you. There's just too much to learn and too many potential places to go when you hit a brick wall. Wouldn't it be nice to have a library of solutions to solve these problems quickly and easily? This book provides just that, with more than 100 solutions to common problems in one handy volume. Flex Solutions: Essential Techniques for Flex 2 and Flex 3 Developers faces problems and provides solutions that can be applied to any project, from the most simple to the most complex. The solutions range from customizing Flex components with ActionScript 3.0, using the data models and the ActionScript classes as Value objects, validating and formatting data, using RPC classes to access remote data, to optimizing data-exchange performance using AMF3. Solutions are also provided for enhancing the security of Flex applications, and techniques are offered for optimizing the actual work environment by increasing the performance of Flex Builder, adding video content, and creating an AIR project to bring your web application onto the desktop. If you want to learn about and start to develop rich Internet applications in a short time, being immediately productive and mastering the Flex development techniques, Flex Solutions: Essential Techniques for Flex 2 and 3 Developers is the book you need. Discover real-world solutions foreveryday Flex development, saving hours of development time Learn how to customize and extend the Flex Components Model and design and program the look and feel of your Flex applications Learn best practices and tips from a Flex expert for structuring the architecture of Flex applications Use the Flex Remote Procedure Classes to connect to remote data with HTTPServices and the Java Platform, PHP, ColdFusion, WebServices, and RemoteObject Use Flex 3 features such as the AdvancedDataGrid component and the Charting Enhancements feature Port your rich Internet applications onto the desktop with Adobe AIR As a Flex developer, you'll no doubt come across repetitive problems every day in your workwouldn't it be nice to have a library of solutions to turn to, to solve these problems quickly and easily? Well, this book provides just that, with over 100 solutions to common problems in one easy volume. In Flex 2 Solutions, renowned Flash and Flex expert Marco Casario assumes you know the basics, and dives straight into practical code examples that you could build up yourselves via step by step tutorials, and plug straight in to your own code, saving you hours of development time. Areas explored include Flex 2 components, charting, working with remote data, data validation, displaying data with list based controls, controlling the look and feel of your applications, application security, working with dynamic data sources (such as ColdFusion, PHP, and Java backends,) and much more. In each solution, Marco takes you through the workings of the example step by step, and then presents some expert's tips, which will take your understanding further, and give you unique insights into Flex development. Over 100 Solutions to common problems included Plug the code example straight into your own applications, saving hours of development time Covers the full spectrum of Flex 2 topics, from styling your applications, to security, and interfacing with databases. What youll learn Tips on using Flex components How to validate and format data How to manage complex data Filtering, sorting and using cursors on data with collection classes How to consume Web Services using RPC components How to display data using list-based controls How to effectively compile and deploy Flex applications How to customize the lookand feel of your applications How to make your applications more secure How to become more efficient in using the Flex Builder IDE Unique tricks such as calculating memory usage, making your Flex application into an active desktop, and customizing states How to use the ColdFusion Extensions for Flex Builder How to interface your Flex applications with server-side code written in PHP, Java, Rails, and ColdFusion Working with Flex in enterprise environment using the Flex Data Services, Java Remote Object and AMFPHP Who is this book for? This book is for any Flex developer who is comfortable with the basics and wants to take their knowledge further with quick fire solutions to common problems This book is for any Flex developer who is comfortable with the basics and wants to take their knowledge to the next level. It provides a library of over 100 solutions to common problems. Each solution takes you through the workings of the example step-by-step and then presents some expert's tips, which will take your understanding further and give you unique insights into Flex development. Coverage includes Flex 2 components, charting, working with remote data, data validation, displaying data with list based controls, controlling the look and feel of applications, application security, and working with dynamic data sources.