Đang chuẩn bị liên kết để tải về tài liệu:
Flash Builder 4 and Flex 4 Bible- P16

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Flash Builder 4 and Flex 4 Bible- P16: When Macromedia first released Flash MX in 2002, the product was branded as the new way to build Rich Internet Applications (known by the acronym RIA). The term was invented at Macromedia to describe a new class of applications that would offer the benefits of being connected to the Internet, including access to various types of Web-based services, but would solve many of the nagging issues that had been inherent in browser-based applications since the mid-1990s | Chapter 23 Working with HTTPService and XML 8. Save and run the application. As shown in Figure 23.9 you should see that the application automatically retrieves and displays the data upon startup. FIGURE 23.9 Data returned using code generated by Flash Builder Listing 23.2 shows the completed application code. Notice that the use of the generated service and value object classes makes the application code itself very simple. LISTING 23.2 A completed application using generated HTTP data connection code xml version 1.0 encoding utf-8 s Application xmlns fx http ns.adobe.com mxml 2009 xmlns s library ns.adobe.com flex spark xmlns mx library ns.adobe.com flex mx xmlns contactservice services.contactservice. fx Script CDATA import mx.events.FlexEvent import mx.controls.Alert protected function dataGrid_creationCompleteHandler event FlexEvent void getContactsResult.token contactService.getContacts fx Script s layout s VerticalLayout horizontalAlign center paddingTop 20 s layout continued 721 Part III Working with Data LISTING 23.2 continued fx Declarations s CallResponder id getContactsResult contactservice ContactService id contactService fault Alert.show event.fault.faultString showBusyCursor true fx Declarations mx DataGrid id dataGrid creationComplete dataGrid_creationCompleteHandler event dataProvider getContactsResult.lastResult editable true mx columns mx DataGridColumn headerText First Name dataField firstname mx DataGridColumn headerText Last Name dataField lastname mx DataGridColumn headerText Email dataField email mx DataGridColumn headerText Phone dataField phone mx columns mx DataGrid s Application Declaring and Configuring HTTPService Objects While the new code generation tools are fast and easy to use and generate code that s adequate for most simple Flex applications it s also important to understand how the generated code works. In the next sections of this chapter I describe the HTTPService and CallResponder components and detail how to use them in a .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.