Developing Flex Applications 910p dda_doc88_cracker.zip
文件大小:
13190k
资源说明:This package contains 3 kid:
1. a book Developing Flex Applications
2. a web page viewer for doc88 ebt
3. a DDA downloader for doc88.com
CONTENTS
PART I:
Presenting Flex
CHAPTER 1:
Introducing Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Developing applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Where to next. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
CHAPTER 2:
Using MXML
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
About MXML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The relationship between MXML and ActionScript classes. . . . . . . . . . . . . . . . . . 37
How MXML relates to standards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
CHAPTER 3:
Using ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
About ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Using ActionScript in Flex applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
CHAPTER 4:
Developing Applications
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
About the Flex coding process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Working with a multitier application model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Controlling the appearance of an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Enabling application zooming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Separating ActionScript from MXML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
About the Flex development environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Using Flex development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Architecting an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Improving application start-up time and performance. . . . . . . . . . . . . . . . . . . . . . 78
Summary of Flex application features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4Contents
PART II:
Building User Interfaces to Flex Applications
CHAPTER 5:
Using Flex Components
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
About components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Class hierarchy for components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Using styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Using behaviors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Handling events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Applying skins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Sizing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Changing the appearance of a component at runtime . . . . . . . . . . . . . . . . . . . . . . 99
Extending components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
CHAPTER 6:
Using Controls
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
About controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Working with controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Button control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
CheckBox control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
DateChooser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
DateField control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
HRule and VRule controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
HSlider and VSlider controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Label control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Link control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Loader control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
NumericStepper control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
ProgressBar control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
RadioButton control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
ScrollBar control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Text control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
TextArea control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
TextInput control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
CHAPTER 7:
Using Data Provider Controls
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
About data providers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
ComboBox control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
DataGrid control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
List control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Menu control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
MenuBar control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Tree control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Contents5
CHAPTER 8:
Introducing Containers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
About containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Using containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Controlling component sizing and positioning in a container. . . . . . . . . . . . . . . 246
Using scroll bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Creating component instances at runtime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Configuring containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
CHAPTER 9:
Using the Application Container
. . . . . . . . . . . . . . . . . . . . . . . . . . 265
Using the Application container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Application container syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Showing the download progress of an application . . . . . . . . . . . . . . . . . . . . . . . . 274
CHAPTER 10
:
Using Layout Containers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
About layout containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Canvas layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Box layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
ControlBar layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
DividedBox layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Form layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Grid layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Panel layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Tile layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
TitleWindow layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
CHAPTER 11
:
Using Navigator Containers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
About navigator containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
ViewStack navigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
LinkBar navigator container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
TabNavigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
TabBar navigator container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Accordion navigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
CHAPTER 12
:
Dynamically Repeating Controls and Containers
. . . . . . . . . . . . 351
Using a Repeater object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Dynamically creating components based on data type. . . . . . . . . . . . . . . . . . . . . 359
How a Repeater object executes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
CHAPTER 13
:
Importing Images and Media
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Importing images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Controlling image importing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Using media controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
6Contents
PART III:
Improving User Experience
CHAPTER 14
:
Building an Application with Multiple MXML Files
. . . . . . . . . . . 383
About MXML components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Creating MXML components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Passing component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Using interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
CHAPTER 15
:
Working with ActionScript in Flex
. . . . . . . . . . . . . . . . . . . . . . . . 393
Using ActionScript in Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Working with components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
About scope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Changing the appearance of a component at runtime . . . . . . . . . . . . . . . . . . . . . 407
Importing external resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Using the doLater() method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
CHAPTER 16
:
Using Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
About events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Handling events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Handling mouse events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Using base class events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
CHAPTER 17
:
Creating ActionScript Components
. . . . . . . . . . . . . . . . . . . . . . . 437
About ActionScript components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Defining custom user-interface components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Passing data to a custom tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Defining events in ActionScript components. . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Adding ActionScript components to the Flex environment. . . . . . . . . . . . . . . . . 441
Defining nonvisual components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
CHAPTER 18
:
Creating Cell Renderers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Creating a cell renderer class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
CHAPTER 19
:
Using Styles, Fonts, and Themes
. . . . . . . . . . . . . . . . . . . . . . . . 455
About styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Using external style sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Using local style definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Using the StyleManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Using the setStyle() and getStyle() methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Using inline styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
About fonts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Using themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Skinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Contents7
CHAPTER 20
:
Using Behaviors
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Applying behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Customizing an effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Defining a custom effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Defining and playing an effect in ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Using a custom effect trigger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
CHAPTER 21
:
Using ToolTips
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
About ToolTips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Using ToolTips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Using the ToolTipManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
CHAPTER 22
:
Using the Cursor Manager
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
About the Cursor Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Cursor Manager syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
CHAPTER 23
:
Using the Drag and Drop Manager
. . . . . . . . . . . . . . . . . . . . . . . 531
About the Drag and Drop Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Using a List, Tree, or DataGrid control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Drag and Drop Manager syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
CHAPTER 24
:
Using the History Manager
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
About history management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Using standard history management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Using custom history management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
How the HistoryManager class saves and loads state . . . . . . . . . . . . . . . . . . . . . . 554
Using history management in a custom HTML file . . . . . . . . . . . . . . . . . . . . . . 555
CHAPTER 25
:
Applying Deferred Instantiation
. . . . . . . . . . . . . . . . . . . . . . . . . 557
About deferred instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Using deferred instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Manually instantiating controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Using the childDescriptors property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Starting applications incrementally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
CHAPTER 26
:
Printing from SWF Files
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
About Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
Printing from the Flash Player context menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
Using the ActionScript PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
Starting a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
8Contents
PART IV:
Data Access and Interconnectivity
CHAPTER 27
:
Creating Accessible Applications
. . . . . . . . . . . . . . . . . . . . . . . . 583
Accessibility overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
About screen reader technology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Configuring Flex applications for accessibility. . . . . . . . . . . . . . . . . . . . . . . . . . . 585
Using accessible components and managers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Creating tab order and reading order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Accessibility for hearing-impaired users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Testing accessible content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
CHAPTER 28
:
Managing Data in Flex
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
About Flex data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
Comparing Flex data management to other technologies. . . . . . . . . . . . . . . . . . . 597
CHAPTER 29
:
Binding and Storing Data in Flex
. . . . . . . . . . . . . . . . . . . . . . . . 601
Binding data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Using data models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
CHAPTER 30
:
Validating Data in Flex
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
Validating data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
Using standard validators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
CHAPTER 31
:
Formatting Data
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Using formatters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Writing an error handler function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Using the standard formatters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
Creating a custom formatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
CHAPTER 32
:
Using Data Services
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
About data services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
Declaring a data service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
Calling a data service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
Handling data service results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
Using a service with binding, validation, and event handlers. . . . . . . . . . . . . . . . 669
Handling asynchronous calls to data services. . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
Using callback URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
Generating debugging information for data services . . . . . . . . . . . . . . . . . . . . . . 674
Securing data services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Working with web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Working with remote object services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Data service tag properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Data service whitelist tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
Contents9
PART V:
Advanced Application Development and Debugging
CHAPTER 33
:
Debugging Flex Applications
. . . . . . . . . . . . . . . . . . . . . . . . . . . 705
About debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
Enabling debug and warning messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
Using the error-reporting mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
Supported errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
About the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
Configuring the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Invoking the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
Using the debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
CHAPTER 34
:
Profiling ActionScript
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
About profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
About the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
Using the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
Analyzing data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
CHAPTER 35
:
Using the Flex JSP Tag Library
. . . . . . . . . . . . . . . . . . . . . . . . . 741
Introduction to the Flex JSP tag library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Using the Flex JSP tag library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
About the Flex tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Using the tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
Using the tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
Using the tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
PART VI:
Administrating Applications
CHAPTER 36
:
Administering Flex
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
Using the command-line compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
Editing the flex-config.xml file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
Changing application server settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
Configuring logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
CHAPTER 37
:
Applying Flex Security
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
Flex security features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
Flash Player security features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
Security concerns of an open format technology . . . . . . . . . . . . . . . . . . . . . . . . . 782
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
10
Contents
CHAPTER 38
:
Deploying Applications
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
About deploying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
Adding Flex to your application server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
Distributing components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
Working with Flex files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
About the HTML wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
Passing request data to Flex applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
Flash Player detection and deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
Managing Flash Player auto-update. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
PART VII:
Custom Components
CHAPTER 39
:
Working with Flash MX 2004
. . . . . . . . . . . . . . . . . . . . . . . . . . 817
About creating components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
Working in the Flash environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
Working with component symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
Exporting components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
CHAPTER 40
:
Creating Basic Components in Flash MX 2004
. . . . . . . . . . . . 835
Creating simple components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
Working with component properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
Binding properties to a custom component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
Adding events to custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
Setting default sizes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
Styling custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
Skinning custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
Creating compound components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
CHAPTER 41
:
Creating Advanced Components in Flash MX 2004
. . . . . . . . . 857
Creating components overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
Writing the component’s ActionScript code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
Skinning custom controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
Adding styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
Making components accessible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
Improving component usability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
Best practices when designing a component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
ModalText.as example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
PART I
Presenting Flex
This part describes the Macromedia Flex Presentation Server. These chapters introduce Flex, and the two languages that you use to develop Flex applications: MXML and ActionScript. This part also includes an introduction to building Flex applications. The following chapters are included:Chapter 1: Introducing Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 2: Using MXML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Chapter 3: Using ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter 4: Developing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
PART I
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。