Flash Builder 4 and Flex 4 Bible- P16

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 you should see that the application automatically retrieves and displays the data upon startup. FIGURE Data returned using code generated by Flash Builder Listing 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 A completed application using generated HTTP data connection code xml version encoding utf-8 s Application xmlns fx http mxml 2009 xmlns s library flex spark xmlns mx library flex mx xmlns contactservice . fx Script CDATA import import protected function dataGrid_creationCompleteHandler event FlexEvent void fx Script s layout s VerticalLayout horizontalAlign center paddingTop 20 s layout continued 721 Part III Working with Data LISTING continued fx Declarations s CallResponder id getContactsResult contactservice ContactService id contactService fault showBusyCursor true fx Declarations mx DataGrid id dataGrid creationComplete dataGrid_creationCompleteHandler event dataProvider 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 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.