This book a great way to get you working in Flex fast... if you already have a good understanding of AS3 from a Flash background. If you're not familiar with AS3 than there are some sticking points that slow you down. But if you're goal is to transition form working in Flash to working in Flex, then this book is an excellent place to start.
Author(s): Sas Jacobs
Edition: 1
Publisher: friends of ED
Year: 2007
Language: English
Pages: 573
Foundation Flex for Developers......Page 0
CONTENTS AT A GLANCE......Page 5
CONTENTS......Page 7
ABOUT THE AUTHORS......Page 19
ABOUT THE TECHNICAL REVIEWER......Page 21
ABOUT THE COVER IMAGE DESIGNER......Page 23
ACKNOWLEDGMENTS......Page 25
INTRODUCTION......Page 27
FLEX APPLICATION BASICS......Page 29
INTRODUCTION TO FLEX......Page 31
Understanding web applications......Page 32
Understanding the role of Flex......Page 33
Understanding the role of MXML and ActionScript 3.0......Page 34
Understanding MXML......Page 35
Understanding ActionScript 3.0......Page 36
Understanding the major changes in ActionScript 3.0......Page 37
Working with applications in Flex......Page 39
Flex tools for working with data......Page 40
Useful resources......Page 41
Summary......Page 42
WORKING WITH ACTIONSCRIPT 3.0 IN FLEX 3......Page 45
Working with ActionScript 3.0 in Flex applications......Page 46
Using inline ActionScript statements......Page 47
Using the element......Page 50
Using include inside an element......Page 55
Creating custom class files......Page 56
Creating ActionScript projects......Page 64
Working with a minimal Flex interface......Page 65
Understanding ActionScript 3.0 events......Page 68
What happened to trace?......Page 70
Importing classes......Page 71
Summary......Page 72
CREATING CUSTOM COMPONENTS......Page 75
Creating components using MXML......Page 76
Example: Creating a country ComboBox component......Page 77
Passing a value to the component......Page 79
Binding a property in the component......Page 82
Dispatching events......Page 83
Creating a custom event class......Page 84
Creating a composite component......Page 87
Working through examples......Page 91
Passing values to ActionScript components......Page 93
Dispatching custom events in ActionScript components......Page 94
Deciding on MXML or ActionScript......Page 95
Using the code-behind approach......Page 96
Sharing components......Page 97
Distributing SWC files......Page 98
Using SWC files......Page 99
Summary......Page 100
INTERACTING WITH USERS......Page 103
Adding a message and title......Page 104
Adding a closeHandler method......Page 105
A simple example......Page 106
Changing the appearance of the alert......Page 110
Working with pop-ups......Page 112
A simple example......Page 113
Passing values from the pop-up......Page 117
Passing values to the pop-up......Page 120
Responding to pop-up events......Page 121
Understanding the Form container......Page 124
Working with a data model......Page 125
Determining required values......Page 129
Validating user input......Page 130
Working with the DateValidator......Page 132
Working with the NumberValidator......Page 133
Working with the StringValidator......Page 134
Adding validation to a form......Page 135
Validating with validator events......Page 137
Validating with ActionScript......Page 138
Using the DateFormatter......Page 141
Using the PhoneFormatter......Page 142
Applying the formatter......Page 143
Adding formatters to a form......Page 144
Summary......Page 145
INTERACTING WITH THE WEB BROWSER......Page 147
Loading a web page from Flex......Page 148
Calling JavaScript with navigateToURL......Page 149
Working through a simple example......Page 150
Sending variables into a SWF file......Page 152
Using querystring parameters......Page 153
Using flashVars......Page 156
Understanding the External API......Page 158
Calling a JavaScript function using ActionScript......Page 159
Calling an ActionScript function with JavaScript......Page 163
Working through a two-way communication example......Page 167
Limitations of the External API......Page 171
Understanding Flash Player security......Page 172
Summary......Page 173
WORKING WITH DATA IN FLEX APPLICATIONS......Page 175
Working with the HTTPService class......Page 176
Receiving a response......Page 177
Accessing loaded content......Page 178
Properties of the HTTPService class......Page 179
Understanding the URLLoader class......Page 181
Specifying a return type......Page 182
Methods of the URLLoader class......Page 183
Comparing the HTTPService and URLLoader......Page 184
Using the tag......Page 185
Using the HTTPService class with ActionScript......Page 187
Using the URLLoader class......Page 188
Using variable pairs with the HTTPService class......Page 189
Using the tag......Page 190
Using the HTTPService class with ActionScript......Page 192
Using the URLLoader class......Page 193
Sending variables with the URLLoader......Page 194
Updating content with the HTTPService class......Page 195
Updating content with the URLLoader class......Page 200
Understanding security sandboxes......Page 202
Proxying data locally......Page 203
Separating data from presentation......Page 204
Working with the tag......Page 205
Using ActionScript to work with complex data structures......Page 207
Understanding data binding......Page 215
Binding with curly braces syntax......Page 216
Binding with the tag......Page 217
Binding with ActionScript......Page 223
Working through a scripted binding example......Page 226
Understanding validators......Page 229
Understanding formatters......Page 232
Summary......Page 235
INTRODUCTION TO XML......Page 237
Understanding the XML framework......Page 238
A brief history......Page 239
Understanding why you should use XML......Page 240
Using XML information......Page 241
The document prolog......Page 242
The document tree......Page 244
Namespaces......Page 248
A simple MXML document......Page 249
Element structure......Page 250
Elements must nest correctly......Page 251
Summary......Page 252
USING XML IN FLEX BUILDER......Page 255
Understanding E4X expressions......Page 256
Understanding the XML and XMLList classes......Page 259
Manipulating XML content......Page 264
Working with the tag......Page 266
Using the tag......Page 268
Using the HTTPService class with ActionScript......Page 270
Using the URLLoader class......Page 271
Binding XML content with E4X expressions......Page 272
Working through an example......Page 273
Working with the WebService class......Page 281
Consuming a web service with the tag......Page 287
Consuming a web service with ActionScript......Page 291
Summary......Page 293
FLEX DATA-DRIVEN CONTROLS......Page 295
Working with a dataProvider......Page 296
Setting the dataProvider......Page 297
Using XML as a dataProvider......Page 298
Iterating through controls in a Repeater......Page 299
Working through a simple example......Page 300
Displaying images in a TileList......Page 304
Changing the direction......Page 306
Using a custom item renderer......Page 307
Working through an example......Page 309
Using the DataGrid......Page 312
Specifying column settings......Page 313
Reordering columns......Page 315
Setting the display of data within a column......Page 316
Using renderers......Page 317
Editing content......Page 321
Working with rows......Page 325
Using common DataGrid events......Page 326
Working through a DataGrid example......Page 329
Summary......Page 337
DEBUGGING FLEX APPLICATIONS......Page 339
Working with the trace method......Page 340
Logging to a text file......Page 341
Working with the tag......Page 342
Compiler warning messages......Page 343
Compiler errors......Page 344
Run-time errors......Page 345
Using ActionScript to catch run-time errors......Page 346
Using the debugger......Page 351
Adding breakpoints......Page 353
Viewing variable values......Page 354
Changing the value of a variable......Page 356
Watching a variable......Page 357
Summary......Page 358
PART 2 DATA-DRIVEN APPLICATIONS......Page 359
XML CASE STUDY......Page 361
The application interface......Page 362
Structuring the application......Page 364
Creating the interface......Page 365
Creating the custom class......Page 366
Writing the custom class......Page 367
Creating the constructor method......Page 368
Loading the XML document......Page 369
Creating the GalleryLoader object......Page 370
Processing the loaded XML content......Page 371
Populating the ComboBox with galleries......Page 373
Creating the interface......Page 374
Configuring the component......Page 375
Displaying the first image......Page 377
Displaying the other images......Page 380
Summary......Page 383
COLDFUSION PROJECT......Page 385
Understanding the application......Page 386
The application data source......Page 388
Connecting to the ColdFusion server......Page 389
Creating the ColdFusion page......Page 392
Creating the Flex application......Page 394
Creating the Flex interface......Page 395
Summary......Page 401
ASP.NET CASE STUDY......Page 403
The application interface......Page 404
The application data source......Page 406
Structuring the application......Page 409
Creating the application......Page 411
Creating the Flex application interface......Page 412
Creating the ASP.NET pages to generate XML content for the application......Page 414
Creating the custom class......Page 419
Loading the events for a specific date......Page 421
Populating the interface with the events......Page 423
Creating a custom component for event details......Page 427
Showing details of the selected event......Page 434
Updating the selected event......Page 435
Adding a new event......Page 443
Deleting an event......Page 444
Summary......Page 447
PHP CASE STUDY......Page 449
The application interface......Page 450
The application data source......Page 454
Structuring the application......Page 456
Creating the application......Page 457
Creating the Flex application interface......Page 458
Creating the PHP pages to generate the XML content......Page 461
Creating the custom ActionScript class to load the content......Page 464
Loading the XML content......Page 466
Creating custom events......Page 467
Displaying the current posts......Page 470
Displaying the archive posts......Page 473
Coding the login form......Page 476
Creating a custom component for post details......Page 480
Updating the selected post......Page 482
Adding a new post......Page 491
Deleting an existing post......Page 492
Summary......Page 494
LIVECYCLE DATA SERVICES......Page 495
INTRODUCTION TO LIVECYCLE DATA SERVICES......Page 497
LiveCycle Data Services features......Page 498
Installing LiveCycle Data Services ES......Page 499
Set up a Flex application for use with LiveCycle Data Services ES......Page 502
Using LiveCycle Data Services......Page 503
Building a basic chat application......Page 504
Exploring web and HTTP services......Page 509
Exploring the remote object service......Page 517
Data Management Services......Page 525
Using DMS with SQLAssembler......Page 527
Summary......Page 537
LIVECYCLE DATA SERVICES CASE STUDY......Page 539
The book admin application......Page 540
The book viewer application......Page 541
The server-side configuration......Page 542
Creating the book admin application......Page 544
Showing the selected book details......Page 545
Updating the selected book details......Page 549
Deleting a Book object......Page 550
Uploading a book cover to the server......Page 551
Adding an application ControlBar......Page 556
Setting up the Flex DataService......Page 557
Building the custom item renderer......Page 558
Showing the books in a TileList......Page 559
Showing the details of each book......Page 560
Summary......Page 561
INDEX......Page 563