没有合适的资源?快使用搜索试试~ 我知道了~
首页Flex 4与Flash Builder 4开发详解
"Flash Builder 4 & Flex 4 宝典是David Gassner撰写的一本详尽的开发指南,涵盖了Adobe的Flex 4平台和Flash Builder 4工具的最新特性。这本书旨在帮助开发者创建跨平台的桌面和Web应用程序,包括针对Windows、Mac OS X和Linux的操作系统。书中不仅讲解了基础概念,还覆盖了升级从Flex 3到Flex 4的流程,以及如何使用AIR构建桌面应用,并与各种应用服务器集成,如ColdFusion、ASP.NET和PHP。"
该书内容丰富,分为五个部分:
**第一部分:Flex基础**
- 第1章介绍Flex 4的新特性。
- 第2章深入解析Flash Builder 4的新工具和功能。
- 第3章至第7章逐步指导如何构建基本的Flex应用,调试应用,以及处理事件。
**第二部分:Flex应用设计**
- 第8章至第17章涵盖Flex的可视化控件、文本处理、布局容器、CSS、动画、视图状态管理、图形声明、组件皮肤和弹出窗口的使用。
**第三部分:数据处理**
- 第18章至第24章涉及数据建模、列表控制、高级列表控制、图表、数据输入表单、HTTPService、XML处理和E4X的XML管理。
**第四部分:与应用服务器集成**
- 第25章至第29章讲解如何与基于SOAP的Web服务交互,与BlazeDS和Java整合,使用Message Service,以及与ColdFusion和PHP的集成。
**第五部分:附加主题**
- 第30章讨论Flex 4应用的本地化,第31章则涵盖了使用Adobe AIR部署桌面应用。
本书提供了丰富的代码示例,帮助开发者快速启动开发项目,无论你是Flex新手还是有经验的开发者,都能从中受益,提升在Flex 4和Flash Builder 4平台上的开发能力。
xiv
Contents
Chapter 11: Using Cascading Style Sheets....................... 341
About Cascading Style Sheets ............................................................................................341
What Is a Style Sheet? .......................................................................................................343
Using Inline Style Declarations ..........................................................................................344
Declaring Style Sheets with <fx:Style> ...............................................................................345
Using Style Selectors .........................................................................................................346
Using type selectors .................................................................................................346
Using descendant selectors ......................................................................................350
Using style name selectors .......................................................................................351
Using ID selectors ...................................................................................................352
Using the global selector .........................................................................................352
Using Embedded Style Sheets ...........................................................................................353
Using External Style Sheets ...............................................................................................356
Creating a blank style sheet .....................................................................................356
Exporting existing styles ..........................................................................................359
Using Compiled Style Sheets .............................................................................................363
Compiling style sheets .............................................................................................363
Loading compiled style sheets .................................................................................363
Controlling Styles with ActionScript .................................................................................366
Setting and getting style information .......................................................................366
Modifying style selectors at runtime ........................................................................367
Summary ..........................................................................................................................370
Chapter 12: Controlling Animation and
Working with Drag and Drop................................. 371
Using Effects .....................................................................................................................372
Declaring and playing effect classes .........................................................................373
Declaring effects in ActionScript ..............................................................................375
Using the new Spark effects .....................................................................................377
Using composite effects ...........................................................................................383
Using easing classes .................................................................................................387
Using Drag-and-Drop Operations .....................................................................................388
Implementing drag-and-drop with List controls ......................................................389
Implementing custom drag-and-drop operations ....................................................391
Summary ..........................................................................................................................398
Chapter 13: Managing View States............................. 399
Understanding View States ................................................................................................400
Defining View States in Design View .................................................................................401
Creating a new state ................................................................................................401
Defining a view state’s overrides ..............................................................................404
Switching View States at Runtime .....................................................................................406
Declaring View States in MXML ........................................................................................407
Adding and removing components ..........................................................................408
Overriding properties, styles, and event handlers ....................................................409
02_488959-ftoc.indd xiv02_488959-ftoc.indd xiv 3/5/10 2:17 PM3/5/10 2:17 PM
xv
Contents
Managing View States in Components ..............................................................................412
Using Transitions ..............................................................................................................414
Declaring a transition ..............................................................................................414
Using Parallel and Sequence effects in transitions ....................................................415
Summary ..........................................................................................................................418
Chapter 14: Declaring Graphics with MXML and FXG ............... 419
Declaring Vector Graphics in MXML .................................................................................420
Drawing lines and shapes ........................................................................................420
Adding visual effects ...............................................................................................425
Using FXG Files ................................................................................................................432
Creating FXG graphics with Creative Suite software ................................................432
Using FXG files in Flex applications ........................................................................439
Summary ..........................................................................................................................442
Chapter 15: Skinning Spark Components ........................ 443
Creating and Using Spark Custom Skins ...........................................................................444
Skinning a Spark application ...................................................................................444
Binding a custom skin to a Spark component ..........................................................451
Skinning Other Spark Components ..................................................................................455
Creating a new skin .................................................................................................455
Assigning custom skins with CSS ............................................................................461
Customizing the skin ..............................................................................................462
Summary ..........................................................................................................................467
Chapter 16: Managing Application Navigation.................... 469
Understanding Classic Web Navigation ............................................................................470
Understanding Flex Navigation .........................................................................................471
Using Navigator Containers ..............................................................................................471
Declaring a ViewStack in MXML .............................................................................472
Using custom components in a navigator container .................................................472
Creating a ViewStack in Design mode .....................................................................473
Working with navigator containers in ActionScript .................................................477
Managing creation policy ........................................................................................482
Managing navigator container dimensions ...............................................................484
Using Navigator Bar Containers ........................................................................................484
Using a data collection as a dataProvider .................................................................485
Handling navigator bar events .................................................................................487
Using a ViewStack as a dataProvider .......................................................................487
Managing navigator bar presentation .......................................................................488
Using Menu Controls ........................................................................................................491
Menu data providers ...............................................................................................492
Handling menu events ............................................................................................493
Using the Menu control ...........................................................................................494
Using the MenuBar control......................................................................................495
02_488959-ftoc.indd xv02_488959-ftoc.indd xv 3/5/10 2:17 PM3/5/10 2:17 PM
xvi
Contents
Using Other Navigator Containers ....................................................................................497
The TabNavigator container ....................................................................................498
The Accordion container .........................................................................................500
TabNavigator and Accordion keyboard shortcuts ....................................................501
Summary ..........................................................................................................................502
Chapter 17: Working with Pop-up Windows ..................... 503
Using the Alert Class .........................................................................................................504
Presenting pop-up windows with Alert.show() ........................................................504
Controlling Alert window modality .........................................................................504
Managing Alert window buttons .............................................................................506
Handling Alert window events ................................................................................508
Using a custom graphical icon .................................................................................509
Using CSS selectors with the Alert class ...................................................................512
Using the PopUpMenuButton Control ..............................................................................514
Creating a data provider ..........................................................................................514
Handling events ......................................................................................................515
Using the PopUpButton control ........................................................................................517
Declaring the pop-up window .................................................................................518
Handling events and managing pop-up behavior ....................................................518
Working with Custom Pop-up Windows ..........................................................................521
Defining a custom pop-up window .........................................................................521
Managing custom pop-up windows with the PopUpManager class..........................524
Summary ..........................................................................................................................530
Part III: Working with Data 531
Chapter 18: Modeling and Managing Data ....................... 533
Creating a Data Model ......................................................................................................534
Using the <fx:Model> element .................................................................................535
Using Value Objects ..........................................................................................................539
Using the New ActionScript Class wizard ................................................................540
Value object class syntax .........................................................................................541
Instantiating value object classes .............................................................................549
Using Data Collections ......................................................................................................552
Declaring an ArrayCollection...................................................................................553
Setting a data collection object’s source property .....................................................554
Accessing data at runtime ........................................................................................555
Managing data at runtime ........................................................................................556
Using data cursors ...................................................................................................562
Summary ..........................................................................................................................569
Chapter 19: Using List Controls ............................... 571
Using Data Providers .........................................................................................................574
Using hard-coded data providers ............................................................................575
Using dynamic data providers .................................................................................577
02_488959-ftoc.indd xvi02_488959-ftoc.indd xvi 3/5/10 2:17 PM3/5/10 2:17 PM
xvii
Contents
Controlling List Item Labels ..............................................................................................579
Using the labelField property ..................................................................................579
Using the labelFunction property ............................................................................582
List Control Events and Properties ....................................................................................584
Handling User Data Selections ..........................................................................................585
Using the change event ...........................................................................................585
Using the selectedItem property ..............................................................................585
Using the selectedIndex property ............................................................................587
Selecting complex data objects ................................................................................588
Using Custom Item Renderers ...........................................................................................590
Using drop-in item renderers ..................................................................................591
Using inline renderers and editors ...........................................................................593
Using component item renderers ............................................................................597
Customizing Spark item renderers with view states .................................................600
Summary ..........................................................................................................................602
Chapter 20: Using Advanced List Controls....................... 603
Using ComboBox and DropDownList Controls .................................................................603
Using the prompt property ......................................................................................604
Using the ComboBox control ..................................................................................605
Selecting complex data objects with ActionScript ....................................................607
Using the Spark ButtonBar control ..........................................................................611
Using the DataGrid Control ..............................................................................................613
Customizing the DataGrid display ...........................................................................614
Displaying custom labels in DataGrid column cells .................................................619
Advanced Item Renderers and Editors ..............................................................................622
Using the dataChange event ....................................................................................623
Using Spark item renderers .....................................................................................626
Using item editors ...................................................................................................627
Using List Controls with Horizontal and Tile Layout .........................................................635
Using the AdvancedDataGrid Control ...............................................................................641
Hierarchical data display .........................................................................................641
Grouping flat data ...................................................................................................644
Summary ..........................................................................................................................646
Chapter 21: Using the Flex Charting Controls .................... 647
Understanding Flex’s Types of Charts ...............................................................................648
Declaring Chart Controls ..................................................................................................650
Setting Chart Properties and Styles ....................................................................................652
Using pie charts ......................................................................................................652
Using financial charts ..............................................................................................663
Using bar, column, line, and area charts ..................................................................666
Summary ..........................................................................................................................673
02_488959-ftoc.indd xvii02_488959-ftoc.indd xvii 3/5/10 2:17 PM3/5/10 2:17 PM
xviii
Contents
Chapter 22: Working with Data Entry Forms ...................... 675
Using the Form Container .................................................................................................676
Using the FormHeading control ..............................................................................678
Using the FormItem container .................................................................................680
Setting a default button ...........................................................................................681
Using Custom Form Components .....................................................................................683
Creating a custom Form component .......................................................................683
Adding controls to a Form component ....................................................................685
Validating Data Entry ........................................................................................................687
Creating a validator object .......................................................................................688
Controlling validation with trigger events ................................................................688
Controlling validation with ActionScript .................................................................691
Controlling validation rules and error messages ......................................................695
Sharing Data with the Application .....................................................................................697
Modeling Form data with a value object ..................................................................697
Dispatching a custom event .....................................................................................699
Summary ..........................................................................................................................705
Chapter 23: Working with HTTPService and XML .................. 707
Using RPC and REST Architectures ...................................................................................708
Understanding the Representational State Transfer architecture ..............................708
Understanding the Remote Procedure Call architecture ...........................................709
Creating Data-Centric Applications with Flash Builder 4...................................................710
Creating and managing data connections ................................................................710
Defining a return data type ......................................................................................714
Binding returned data to visual controls ..................................................................719
Declaring and Configuring HTTPService Objects ..............................................................722
Creating an HTTPService object ..............................................................................722
Essential HTTPService properties ............................................................................723
Sending and Receiving Data ..............................................................................................727
Understanding asynchronous communications .......................................................727
Handling HTTPService responses ............................................................................727
Working with CallResponder and AsyncToken .......................................................736
Working with ItemResponder and AsyncToken ......................................................739
Working with Value Objects .............................................................................................741
Passing Parameters to Server Pages ....................................................................................744
Using named parameters .........................................................................................744
Using bound parameters .........................................................................................745
Handling Cross-Domain Policy Issues ...............................................................................746
Summary ..........................................................................................................................748
02_488959-ftoc.indd xviii02_488959-ftoc.indd xviii 3/5/10 2:17 PM3/5/10 2:17 PM
剩余1058页未读,继续阅读
113 浏览量
105 浏览量
111 浏览量
2009-05-25 上传
2009-02-28 上传
2012-12-16 上传
113 浏览量
2009-05-24 上传
2010-04-29 上传
huzhouhzy
- 粉丝: 83
- 资源: 1652
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- torch_cluster-1.5.6-cp36-cp36m-linux_x86_64whl.zip
- D-无人机:拉无人机。 使用计算机视觉在喷漆墙上画画以实现精确导航
- myloader
- Metro_Jiu-Jitsu-crx插件
- 导航条,鼠标悬停滑动下拉二级导航菜单
- 中国企业文化理念:提炼与实施的流程及方法(第一天课程大纲)
- 使用videojs/aliplayer 实现rtmp流的直播播放
- irt_parameter_estimation:基于项目响应理论(IRT)的物流项目特征曲线(ICC)的参数估计例程
- visualvm_21.rar
- torch_sparse-0.6.4-cp38-cp38-linux_x86_64whl.zip
- redratel:数字代理
- JumpStart!-开源
- api-2
- Adoptrs-crx插件
- redis windows x64安装包msi格式的
- XX轧钢企业文化诊断报告
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功