intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Flash Builder 4 and Flex 4 Bible- P21

Chia sẻ: Cong Thanh | Ngày: | Loại File: PDF | Số trang:50

80
lượt xem
13
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Flash Builder 4 and Flex 4 Bible- P21: 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....

Chủ đề:
Lưu

Nội dung Text: Flash Builder 4 and Flex 4 Bible- P21

  1. Chapter 31: Deploying Desktop Applications with Adobe AIR FIGURE 31.9 An AIR installer’s confirmation screen Uninstalling AIR applications You uninstall an AIR desktop application in the same manner as most other native applications. Follow these steps to uninstall AIR applications in Windows: 1. Go to the Windows Control Panel. 2. Select Add or Remove Programs on Windows XP or Uninstall a program on Windows Vista or Windows 7. 3. Select the application entry. 4. Click Remove on Windows XP or Uninstall on Windows Vista or Windows 7. 5. When the Adobe AIR Setup dialog box appears, click Uninstall to remove AIR from your system. To uninstall an AIR application on Mac OS X, just delete the application package file from the /Applications folder by dragging it into the trash. Note Running the AIR installation package file after the application is installed also results in displaying the setup dialog box and displays the uninstall option. n Flex Application Tips and Tricks with AIR As described earlier in this chapter, the subject of developing Flex applications for desktop deploy- ment with AIR is too large for a single chapter. There are, however, a few specific things you do a bit differently in a desktop application, and there are many Flex SDK features that are available only when you’re developing for AIR. These include: 971
  2. Part V: Additional Subjects l Debugging AIR applications in Flash Builder l Rendering and managing HTML-based and PDF-based content l Using the WindowedApplication component as the application’s root element l Creating channels at runtime for communicating with Remoting gateways In this section, I briefly describe some of these programming and development techniques. On the Web If you want to review the sample applications described in this section, extract the contents of the chap- ter31.zip file into the root folder of the chapter30 Flex desktop application project. Each sample applica- tion includes both an application file and an application descriptor file. n Debugging AIR applications in Flash Builder For the most part, debugging an AIR application in Flash Builder is just like debugging a Web- based Flex application. You have access to all the same debugging tools, including the trace() function, breakpoints, and the capability to inspect the values of application variables when the application is suspended. When you run a Flex application from within Flash Builder in either standard or debug mode, Flash Builder uses ADL (AIR Debug Launcher) in the background. In some cases, ADL can stay in system memory with hidden windows even after an AIR application session has apparently been closed. The symptom for this condition is that when you try to run or debug that or another application, Flash Builder simply does nothing. Because a debugging session is still in memory, Flash Builder can’t start a new one. Follow these steps to recover from this condition in Windows: 1. Open the Windows Task Manager. 2. In the Processes pane, locate and select the entry for adl.exe. 3. Click End Process to force ADL to shut down. 4. Close Task Manager, and return to Flash Builder. Follow these steps to recover from this condition on the Mac: 1. In the Apple menu, select Force Quit. 2. In the Force Quit dialog box, select adl and click the Force Quit button. 3. Close the Force Quit dialog box, and return to Flash Builder. You should now be able to start your next AIR application session successfully. One common sce- nario that can result in this problem is when a runtime error occurs during execution of startup code. For example, if you make a call to a server-based resource from an application-level creation 972
  3. Chapter 31: Deploying Desktop Applications with Adobe AIR Complete event handler and an unhandled fault occurs, the application window might never become visible. If you’re running the application in debug mode, you can commonly clear the ADL from memory by terminating the debugging session from within Flash Builder. When running in standard mode, however, the ADL can be left in memory with the window not yet visible. To solve this issue, it’s a good idea to explicitly set the application’s initial windows as visible. In the application descriptor file, the element’s child property is commented out by default. Because this value defaults to false, if the window construction code never succeeds to a runtime error, you’re left with an invisible window and ADL still in memory. To solve this, open the application’s descriptor file, uncomment the element, and set its value to true: true Working with HTML-based content The Flex framework offers two ways of creating a Web browser object within any application: l The HTMLLoader class is extended from the Sprite class and can be used in any Flash or Flex application. Because this class doesn’t extend from UIComponent, you can’t add it to a Flex container with simple MXML code or by using the addChild()or addElement() methods. l The HTML control is extended from UIComponent and can be instantiated with either MXML or ActionScript code. The HTML control is quite a bit easier to use and provides the same functionality as HTMLLoader. Declaring an instance of the control results in a Web browser instance that can freely navigate to any location on the Web (assuming the client system is currently connected). Instantiating the HTML control As with all visual controls, the HTML control can be instantiated in MXML or ActionScript code. After it’s been instantiated, its location property determines which Web page is displayed. This HTML object, for example, displays Adobe’s home page and expands to fill all available space within the application: When you assign the HTML control’s id property, you can then reset its location as needed from any ActionScript code. This statement resets the HTML control’s location to the Wiley home page: myHTML.location = “http://www.wiley.com”; The application in Listing 31.2 uses an HTTPService object to retrieve an RSS listing from a URL. When the user selects an item from the ComboBox that presents the RSS items, a bit of ActionScript code causes the HTML object to navigate to the selected Web page. 973
  4. Part V: Additional Subjects Note Because the structure of an RSS feed is consistent regardless of the data provider, this application should work with any RSS feed from any data provider. n LISTING 31.2 A Flex desktop application displaying Web pages from an RSS feed
  5. Chapter 31: Deploying Desktop Applications with Adobe AIR ]]> On the Web The code in Listing 31.2 is available in the Web site files in the chapter31 project as NewTitlesReader. mxml. n Figure 31.10 shows the completed application, displaying the contents of the RSS feed in the DropDownList and a currently selected Web page in the HTML component. FIGURE 31.10 A simple RSS feed application displaying Web pages in an HTML component instance 975
  6. Part V: Additional Subjects Navigating with the HTML control In addition to the location property, the HTML control implements these methods that enable you to control navigation with ActionScript code: l historyBack(). Navigates back one step in the control’s history list. l historyForward(). Navigates back one step in the control’s history list. l historyGo(steps:int). Navigates the number of steps. The value of the steps argument can be positive to move forward or negative to move back. As described earlier, the runtime doesn’t include a copy of Acrobat Reader but instead requires that this software package is already installed on the client system. You can find out whether the cur- rent client system is capable of displaying Acrobat PDF documents by evaluating the HTML con- trol’s static pdfCapability property. The property’s value is matched to constants in a PDFCapability class with these values and meanings: l ERROR_INSTALLED_READER_NOT_FOUND. No version of Acrobat Reader is installed. l ERROR_INSTALLED_READER_TOO_OLD. Acrobat Reader is installed, but it’s older than version 8.1. l ERROR_PREFERED_READER_TOO_OLD. Acrobat Reader 8.1 or later is installed, but another older version is viewed by the operating system as the preferred application for PDF documents. l STATUS_OK. Acrobat Reader 8.1 or later is installed. The application in Listing 31.3 is a simple Web browser application. The application’s navi- gate() function examines the file extension of a document requested by a client application. If the file extension is .pdf and Acrobat Reader 8.1 or later isn’t detected, the application displays an error to the user. LISTING 31.3 A browser application reading PDF content
  7. Chapter 31: Deploying Desktop Applications with Adobe AIR myURL = urlInput.text; if (myURL.substr(0,4) != “http”) { myURL = “http://” + myURL; } var fileExtension:String = myURL.substr(myURL.length-3, 3); if (fileExtension.toLowerCase() == “pdf” && HTML.pdfCapability != HTMLPDFCapability.STATUS_OK) { Alert.show(“This request requires Acrobat Reader 8.1 or later”, “Acrobat Error”); } else { myHTML.location = myURL; status = myURL; } } ]]> On the Web The code in Listing 31.3 is available in the Web site files in the chapter31 project as AIRWebBrowser. mxml. n Using the WindowedApplication component Flex applications designed for desktop deployment typically use as the application root element. A beginning desktop application’s code looks like this: 977
  8. Part V: Additional Subjects The WindowedApplication component is extended from Application and provides all the application-level functionality you expect from a typical Flex application. It also adds these capa- bilities that are unique to Flex desktop applications: l Native menus can be displayed and integrated into the overall application look and feel. l The application can be integrated with a dock or system tray icon to provide easy access to common application functions. l The application can display operating system-specific “chrome” (the graphics in the appli- cation window’s border, title bar, and control icons). l A status bar can be displayed at the bottom of the application window for string-based sta- tus messages. Here’s one example: The WindowedApplication component can display a status bar at the bot- tom of the application window. This display is controlled by two of the WindowedApplication component’s properties: l showStatusBar:Boolean. When this property is true (the default), the application window displays a status bar. l status:String. The string value displayed in the status bar. The following modified custom updateHTML() function from the NewTitlesReader applica- tion updates the application’s status bar with the title of the currently selected RSS item: private function updateHTML():void { myHTML.location = feedSelector.selectedItem.link; status = “Current Title: “ + feedSelector.selectedItem.title; } Creating Remoting channels at runtime When a Web-based Flex application communicates with an application server that supports Flash Remoting (known as the Remoting Service in LiveCycle Data Services and BlazeDS), it typically uses a channel definition with dynamic expressions that evaluate at runtime to the location of the server from which the application was downloaded. This is the default my-amf channel delivered with BlazeDS:
  9. Chapter 31: Deploying Desktop Applications with Adobe AIR url=”http://{server.name}:{server.port}/{context.root}/ messagebroker/amf” class=”flex.messaging.endpoints.AMFEndpoint”/> The element’s url attribute uses dynamic expressions to evaluate the server name and port and the context root of the hosting instance of BlazeDS. This approach doesn’t work with desktop applications deployed with AIR, because the concept of “the current application server” doesn’t have any meaning in a desktop application. Instead, you must provide the explicit location of the server-based application to which Remoting requests should be sent at runtime. You can solve this in one of two ways: l If the location of the server providing Remoting Services is always the same, you can define a custom channel in the application’s services configuration file with a hard-coded url: l For flexibility and the capability to set a url at runtime, declare a channel in either MXML or ActionScript code. The RemoteObject component has a channelSet property, cast as a class named ChannelSet, that contains one or more instances of the AMFChannel component. To declare a runtime channel in MXML, nest the tag inside a tag pair’s property. Then nest one or more tags, and assign each a uri property pointing to the selected server and its Remoting url. Note If you declare more than one AMFChannel tag inside the channelSet, they’re treated as a list in order of preference. The client application always tries to use the first channel; if there’s a communication failure, it goes to the next one, and so on. n The following RemoteObject instance declares a single AMFChannel at runtime: 979
  10. Part V: Additional Subjects You can accomplish the same result with ActionScript. The following ActionScript code creates a ChannelSet object, populates it with a single AMFChannel object, and adds it to the RemoteObject component: var endpointURL:String = “http://myserver/messagebroker/amf”; var cs:ChannelSet = new ChannelSet(); var customChannel:Channel = new AMFChannel(“myCustomAMF”, endpointURL); cs.addChannel(customChannel); myRemoteObject.channelSet = cs; Tip You also can create channels at runtime for use with the Message Service, Proxy Service, and Data Management Service when using LiveCycle Data Services or BlazeDS. n Note When communicating with remote servers using the HTTPService or WebService components in a desktop application, you don’t have to deal with the cross-domain security constraint as you do with Web-based Flex applications. Because the application loads locally, it isn’t subject to the restrictions of the Web browser’s security sandbox and can make connections freely over the Web just like any other local application. n A Conclusion about Adobe AIR In addition to the features described in this chapter, AIR applications can accomplish the following tasks that aren’t possible with Flex Web applications: l Full screen and spanned monitor display l Integration with native visual components such the operating system’s window and menu systems l Creation of applications with transparency that serve as widgets l Reading and writing files and folders on the local file system l Persisting data in SQLite, a local database embedded in the runtime l Interacting with the system clipboard, including drag-and-drop to and from AIR applica- tions and the OS l Synchronization of data managed on the server by LiveCycle Data Services l Access to all network services supported by the Flex framework The subject of building and deploying AIR-based desktop applications is worthy of an entire book, and in fact there are many such books available. In particular, check out the Adobe AIR Bible (from Wiley, of course!). 980
  11. Chapter 31: Deploying Desktop Applications with Adobe AIR Summary In this chapter, I described how to build and deploy desktop Flex applications with the Adobe Integrated Runtime. You learned the following: l Adobe AIR enables you to build and deploy cross-operating system desktop applications with Flex, Flash, or HTML. l Users can download and install AIR freely from Adobe Systems. l Flash Builder 4 includes everything you need to build and deploy AIR applications. l Each AIR application requires an application descriptor file that determines how an appli- cation is packaged and delivered. l You must provide a security certificate to create an AIR application installer file. l Flash Builder 4 enables you to create a self-signed security certificate suitable for testing or deployment within an organization. l For public deployment of AIR applications, a security certificate issued by a recognized certificate authority is strongly recommended. l Flex applications built for AIR commonly use as the application’s root element. l The Flex framework’s HTML control displays both HTML and PDF content. l You can declare channels at runtime for use with Remoting destinations called from a Flex-based desktop application. 981
  12. A and Java, passing data between, 840–841 looping, 119 absolute address, 724 Menu control, 494 absolute layout, 78, 133, 253, 311, 330 menu events, handling, 493 absolute sizing, 333, 334 versus MXML, 6–8 absolute-layout properties, Canvas container, 315 MXML and, 101–103 abstraction layer, SOAP-based Web service, 779 named parameters, passing, 744 acceptDragDrop() method, 395 navigator containers, working with, 477–482 access attribute, CFCs, 878 objects, declaring in, 7–8 access modifiers, 115–116, 153, 543, 582 overview, 114 accessor methods, 539, 545–549 package declarations in, 541 Accordion container, 472, 497, 500–502 percentage sizing, 334 acompc command-line tool, 28 to PHP data serialization, 932 Acrobat PDF, 809, 955, 976–977 pie chart, 651 Acrobat Reader, 976 populating value object data with, 699 Action Message Format. See AMF Zend AMF Producer component, 857 ActionScript 2, 99 RemoteObject, 830, 882 ActionScript 3. See also E4X effects; value objects reverse domain package names, 141 ActionScript Virtual Machine, 99 runtime channel, declaring in, 980 arguments, passing to remote methods, 839 serialized objects in, 862 classes, 48, 139–140, 440–441, 897 subtopics, filtering messages with, 869–870 combining MXML and, 120–128 syntax, 114 complex data objects, selecting with, 607–610 text property, 255 component methods, calling with statements, 154–155 TextFlow class, 256 conditional statements, 117–119 validating data entry with, 691–695 Consumer component, 858–859 validator object, 688 control properties and styles, setting with, 251 value objects, 551–552, 842–845, 895–896, 899 controlling styles with, 366–369 variables, declaring, 114–117 controls, instantiating with, 250–251 WebService, 784, 795–796 custom classes, 237–242, 534, 698 XML structure, hard-coded, 752 data collections, 554, 578 XMLListCollection, 755 data conversion from ColdFusion to, 879 ActionScript 3.0 Language Reference, 29 defined, 5 actionscript adapter, 854–855, 862 effects, declaring in, 375–377 ActionScript class option, 238 embedded fonts, declaring, 302 ActionScript Class Warning dialog box, 67 event listener, executing single statement in, 210 ActionScript editor, Flash Builder, 50–51, 125–128, 180–181, fault event, 901 191–192 formatter objects, 306 ActionScript File option, 121 functions, handling events with, 211–213 ActionScript Virtual Machine (AVM), 99, 727, 786 handling events of multiple operations, 791 adapters, Message Service, 850, 854–855 HTTPService object, creating, 723 Add or Remove Programs option, 971 983
  13. Index Add Watch Expression dialog box, 191–192 installing, 958–959 AddAction class, 415 list controls for, 573 AddChild element, 408 LiveCycle Data Services features, 809 addChild() method, 148, 483 local data, retrieving in applications, 578 addChildAt() method, 483 overview, 11, 955–956, 980–981 addData() method, 392, 393 Proxy Service, 821 addElement() method, 112, 148, 252 remoting channels at runtime, creating, 978–980 addElementAt() method, 112 Version 2, 957 addEventListener() method WindowedApplication component, 977–978 custom event class, 245 Adobe AIR Installer application, 959 event name constants, 226–227, 240 Adobe AIR Setup dialog box, 959, 971 fault event, 734–735 Adobe AIR Uninstaller application, 959 menu events, 493 Adobe ColdFusion. See ColdFusion overview, 223 Adobe Community Help application, 29, 55–57 PopUpManager, 525 Adobe Creative Suite, 19, 420, 432–439. See also specific PopUpMenuButton, 518 programs by name RemoteObject component, 901 Adobe Developer Center Web site, 879 removing event listener, 227 Adobe Dreamweaver, 93–96 result event, 732, 833, 885 Adobe Fireworks, 437–439 setting up event listener, 223–225 Adobe Flash Builder 4. See Flash Builder 4 for single method, 791–792 Adobe Flash Catalyst, 4, 5, 10 void return type, 213 Adobe Flash Player. See Flash Player WebService, 785, 788 Adobe Flex 4. See Flex 4 addItem() method, 555, 576 Adobe Flex 4 SDK Command Prompt option, 28 addItemAt() method, 555 Adobe Illustrator, 433–437, 439 Additional compiler arguments section, Properties dialog Adobe Integrated Runtime. See Adobe AIR box, 942, 944, 945 Adobe Labs Web page, 25 addPopUp() method, 524, 525 Adobe Open Source Web site, 809, 810 addResourceBundle() method, 948 Adobe Photoshop, 432–433 addResponder() method, 740 Adobe Web site AddressRenderer.mxml file, 624 AIR installer, 958 ADL (AIR Debug Launcher), 972–973 Flash Player installation from, 24–26 adl command-line tool, 27 Flex themes, 342 Adobe Acrobat PDF, 809, 955, 976–977 FXG specifications, 420 Adobe Acrobat Reader, 976 getting help from, 29 Adobe AIR LiveCycle Data Services features, 809 architecture of, 956–958 adt command-line tool, 27 debugging applications, 972–973 advanced text layout, 288–294 desktop application, creating AdvancedDataGrid control, 572, 641–645. See also list application descriptor file, 963–967 controls Flex project for, 960–963 AdvancedDataGridColumn control, 642 installing, 969–971 AdvDataGridDemo.mxml file, 643 overview, 960 AdvDataGridFlatData.mxml file, 645 packaging release version of, 967–969 AeonGraphical theme, 342 uninstalling, 971 afterLast property, 562 drag-and-drop in, 389 AIR, Adobe. See Adobe AIR versus Flash Player, 18 AIR Debug Launcher (ADL), 972–973 HTML-based content, 973–977 AIR file, 967, 969 HTTPService component method property, 725 airfare search application, 402–406 image types, 282 AIRWebBrowser.mxml file, 977 984
  14. Index AJAX (Asynchronous JavaScript and XML), 470 angleYFrom property, 382 Alert class angleYTo property, 382 buttons, managing, 506–508 angleZFrom property, 382 CSS selectors, using with, 512–514 angleZTo property, 382 custom graphical icon, 509–512 Animate effect, 372, 377–379 events, handling, 508–509 AnimateColor effect, 372 fault event, 734–735, 790, 791, 792 AnimateDemo.mxml file, 378–379 modality, controlling, 504–506 AnimateFilter effect, 372 overview, 503, 504 AnimateProperty effect, 377 Panel container, 327 AnimateShaderTransition effect, 372 RadioButton controls, 270–271 AnimateTransform effect, 372 show() method, 504 animation, 9, 10, 371. See also effects; transitions AlertDemos.mxml file, 512 anonymous class, 594 Alert.NONMODAL constant, 505, 506 anti-aliasing, 297, 303 AlertWithStyles.mxml file, 514 Apache Axis, 779, 780 alias attribute, 894, 895, 896 Apache document root folder, 919 aliases, constants as, 152 Apache Tomcat 6. See Tomcat 6, Apache all value, creationPolicy property, 483 Apache Web server, 917, 918 element, 747 API (application programming interface). See also Logging API allowDisjointSelection property, 273 ArrayList class, modifying data with, 576–577 Allowed IP Addresses screen, ColdFusion Administrator, 906 classes, 208 Allowed Services list, User Manager screen, 906 controls, 250 allowMultipleSelection property, 273, 635 encapsulation, 13–14 allowMultipleSelections property, 584, 585 events, 221 allowScriptAccess parameter, 86 app_creationCompleteHandler() function, 224–225 allow-source-path compiler argument, 952 Appearance view, Flash Builder, 54, 355 element, 866 applets, 91–92 alpha styles, 133, 316 Application component alphaFrom property, 379 calling Web services from, 785 alphaTo property, 379 containership, 111–112 alternatingItemColors style, 614 contentGroup property, 148 altKey property, 220, 222 custom skin for AMF (Action Message Format). See also Zend AMF applying with style sheet declaration, 453 documentation, 825 assigning skin, 451–452 Message Service channels, 852–853 associating with host component, 446–447 overview, 825 creating, 444–446 PHP, services for, 924–925 FXG graphics, adding to, 449–451 RemoteObject class, 205, 578, 830 loading at runtime, 454–455 value object classes, 539 overview, 444 AMF0, 825 skin parts, adding required, 448–449 AMF3, 825 skin states, declaring required, 447–448 AMFChannel component, 878, 979–980 dimensions, controlling, 130–131 AMFPHP, 825, 924, 929–931 layout property, setting, 131–134 amxmlc command-line tool, 28 MenuBar control, 496 anchors, Constraints interface, 331–332 overview, 8, 128–129 angleBy property, 381 passing parameters, 130 angleFrom property, 381 view states, 399 angleTo property, 381 application descriptor file, 963–967, 973 angleXFrom property, 382 application location, 282 angleXTo property, 382 application programming interface. See API; Logging API 985
  15. Index application property, 129 managing data at runtime, 556–562 Application server type drop-down menu, 75, 197, 815, 856 navigator bar container, 485 application servers. See also specific servers by name overview, 552–553 configuring messaging on, 851–856 receiving complex messages, 862–863 filtering messages on, 865–871 source property, 554 Flash Remoting, configuring on, 877–878 value objects, working with, 742 HTTPService, 707, 709, 744–745 WebService result event, 788 supported, 46–48 ArrayList class Application type drop-down menu, 46, 75, 815, 856 charting controls, 649 application value, element, 829–830 DataGrid control, 614 application window, MAMP, 917–918, 919 getItemAt() method, 585 element, 964 itemRenderer property, 629 Application.cfc file, 783 label property, 579 applications, Flex. See Flex applications list controls, 575, 577 AppLoadStyleAtRunting.mxml file, 455 modifying data with API, 576–577 AppWithButtonsComplete.mxml file, 462 navigator bar container, 485–486 AppWithButtons.mxml file, 455, 461, 466 overview, 552–553 AppWithCustomSkin.mxml file, 452 RPC components, 578 AppWithSkinStyleSheet.mxml file, 453 source property, 554 area charts, 649, 666–667, 670–672 ArrayUtil.toArray() method, 538–539 AreaChart component, 649 arrowKeysWrapFocus property, 613 AreaSeries series class, 649, 672 as ActionScript operator, 788 argumentCollection attribute, 893 .as extension, 120–121 arguments. See also specific arguments by name asdoc command-line tool, 28 event object, 213–214 ASP.NET, Microsoft, 470, 779, 781 instantiating value objects with default values, 552 assets, Flex Library Project, 156 passing to CFC functions, 891–900 assets folder, 164–165, 437 passing to remote methods, 838–840 Assets tab, New Flex Library Project wizard, 156 Array class asynchronous (nonblocking) I/O channels, 853 adding new test expressions to helper class, 770 asynchronous communications, 727 ArrayUtil.toArray() method, 538–539 Asynchronous JavaScript and XML (AJAX), 470 data collection object source property, 554 AsyncMessage class, 857, 859, 862 menu data providers, 492 AsyncToken class, 736–741, 794, 837 navigator bar container, 485 attribute() function, 756 receiving value objects from ColdFusion, 897–898 attributes. See also specific attributes by name trace() function, 172 adding to objects, 765–766 array notation, extracting data from XML objects with, 759–760 deleting, 766–770 array value, resultFormat property, 726 filtering XML data with predicate expressions, 761 ArrayCollection class modifying values of, 765 accessing data at runtime, 555–556 order of declaration in MXML, 345 bindable variable as, 731–732 value object properties, 549–550 charting controls, 649 values, in MXML, 104 data collection, declaring for, 553 XML, versus child elements, 109 data cursors, 562–569 XML object, modifying, 765–770 as data provider for PopUpMenuButton, 515 auto value, creationPolicy property, 482 DataGrid control, 614 autoCenter Transform property, 381, 382 flat data, 644 Auto-detect the return type from sample data option, 802 HTTPService responses, handling, 728 auto-detecting return type, 714 list controls, 578 automatic garbage collection, 116 986
  16. Index automatic validation, 688–690 overview, 135–136 AVM (ActionScript Virtual Machine), 99, 727, 786 RemoteObject results, 831–832 Axis, Apache, 779, 780 shorthand MXML, 136–137 value object properties, 549, 550 view state, controlling with, 407 B ViewStack, setting as dataProvider, 487 backgroundAlpha setting, 316 WebService results, 786–787 backgroundColor style, 128, 276, 343 BindingUtils class, 136 backgroundFill property, 324 bitmap graphics, 430, 432–433, 437, 440 backgrounds, pie chart, 660–662 BitMapAsset object, 394 backward navigation, 478–481 BitMapClass object, 394 bar charts, 649, 666–670 BitMapFill class, 660 BarAndColumnDemo.mxml file, 670 element, 433 BarChart component, 647–648, 649, 668 BitmapImage control BarSeries series class, 649 changing images at runtime, 285–286 Basic Latin character set, 301 defined, 421 basic layout, 78, 133–134, 311, 320, 331 effects, 385 BasicLayout layout class, 131, 133 embedding images, 284–285 beans. See value objects external resource bundles, 951 beforeFirst property, 562 overview, 281–283 bgcolor parameter, 86 resizing images, 283–284 bidirectional text, 292–294 Blank State option, 402 binary distribution, BlazeDS, 810 BlazeDS. See also Message Service; Remoting Service binary files, 9 data connections, 845–847 Bind to Data dialog box, 719–720, 803–804 downloading, 810–811 bindable properties Flex projects, creating for use with, 814–816 complex data objects, 588–589 included in ColdFusion 9, 874 tag, 137–139 messaging architecture, 849 MXML component, 150–151 overview, 807–808 result event, 731, 884 Proxy Service, 817–824 value objects, 544–545 RemoteObject component XML structure, 752 instantiating, 830 [Bindable] metadata tag overview, 830 accessor method properties, 548 passing arguments to remote methods, 838–840 ArrayCollection class, 553 passing data between ActionScript and Java, 840–841 complex data objects, 588, 589 remote methods, calling, 830–831 making properties bindable, 138, 150 results, handling, 831–838 value objects, 544, 551 value object classes, 841–845 bin-debug folder, 47, 76, 169 sample applications, 813–814 binding expressions sample database, starting, 813 bound parameters, 745 starting, 811–813 ColdFusion Component results, 883–884 supported platforms, 808–809 component methods, calling with, 154 BlazeDS context root folder, 816 external resource bundles, 952 BlazeDS WEB-INF/flex folder, 816 formatter classes in, 307–308 blazedsfiles folder, 816 tag, 137 blazeds.war BlazeDS instance, 811 HTTPService responses, 728–730 blocking I/O, 853 making expressions bindable, 137–139 body property, 857, 859, 862 Model object, 535–536, 537 bookItem format, 393 outputting current date, 944 bookmark property, 567 987
  17. Index bookmarking data, with cursors, 567–569 BubbleChart component, 649 BookmarkingData.mxml file, 569 bubbles property, 228, 237, 240, 699 Books.mxml file, 473 BubbleSeries series class, 649 BookStoreAccordion.mxml file, 501 bubbling, event, 227–229 BookStoreIndexNavigation.mxml file, 480 Build Automatically feature, 54, 81 BookStoreMenuBar.mxml file, 497 build path, Flex Project, 159 BookStore.mxml file, 474 bundleName property, 947 BookStoreNavBar.mxml file, 488 Button class, 208–209, 210 BookStoreReferenceNavigation.mxml file, 482 Button control BookStoreTabNav.mxml file, 499 addEventListener(), 225 BookStoreVerticalButtonBar.mxml file, 491 custom skin, 461–467 BookStoreVerticalNav.mxml file, 490 default button, 682 Boolean expressions, 114, 117, 557 descendant selector in, 354 border styles, 512 event bubbling, 227–228 BorderContainer component, 323–325 event handler for, 214, 215–216, 223 BorderContainerDemo.mxml file, 324 exporting existing styles, 359–361 borderStroke property, 324 Form component, adding to, 686 bottom property, 332, 423 overview, 266–267 Bounce class, 387–388 selectedIndex property, 478–479 bound argument notation, 839, 840 skin, creating new by copying default skin, 455–460 bound arguments, passing to CFC functions, 891, 892 trigger events, controlling validation with, 689 bound CSS declarations, 368–369 button controls, 266–271. See also specific controls by name bound parameters, 745, 797–798 Button portion, PopUpMenuButton, 515–517 Box, Don, 778 ButtonBar control. See also list controls box model, CSS, 319 defined, 484, 571, 572 Box superclass, 312–313 generating using dataProvider, 485–486 BreakElement class, 289 Spark, use of, 611–613 Breakpoint Properties dialog box, 182 Spark versus MX, 488 breakpoints vertical, 490–491 Breakpoints view, 183–185 ButtonBarDemo.mxml file, 612 clearing, 180 buttonDown property, 220 conditional, 181–183 buttonMode property, 440 Debug view, controlling application execution with, buttons. See also specific button controls by name 192–194 default, 507–508, 681–683 debugging event object, 220 pop-up window, 506–508 debugging session, using in, 185–187 buttonWidth property, 507 defined, 167 inspecting variables and expressions adding expression, 191–192 C Expressions view, 191 C command, 424 Variables view, 187–188 caching, 708, 809 watchpoints, setting, 188–191 Cairngorm microarchitecture, 741 removing, 180–181 calculator.as file, 123–124 setting, 180–181 Calculator.mxml application, 122–123 Breakpoints view, Flash Builder, 55, 183–185 CalculatorWithScript.mxml file, 122 “A Brief History of SOAP,” 778 calendar, for date controls, 273–274 bringToFront() method, 524, 525 Call Trace option, 173 brittle applications, 12 CallAction class, 415 browser, Web. See Web browser CallComponentMethodWithAS.mxml file, 155 bubble charts, 649 callout value, labelPosition style, 652 988
  18. Index CallResponder class, 736–739, 794–795, 837–838 PopUpMenuButton, 518 CallResponderDemo.mxml file, 739 RadioButtonGroup control, 271 camel case, 345, 347 ScrollBar controls, 278–279 cancel event, 523 Slider control, 280, 281 cancelable property, 240 TileList control, 635 cancelLabel property, 506 Change Font Size button, 366–367 candlestick charts, 650, 663–666 ChangeEventDemo.mxml file, 586 CandleStickChart component, 650 ChangeLocaleAtRuntime.mxml application, 945–947 CandleStickSeries series class, 650 changing event, 584 Canvas container, 312, 315–317, 318, 328, 330 ChangingSelectors.mxml file, 369 CanvasDemo.mxml file, 316 tag, 829, 878 Cascading Style Sheets. See CSS, selectors, CSS channels, 851–854, 878, 978–980 case sensitivity, 104, 114, 260, 346 tag, 853–854, 855 caseInsensitive property, 560 ChannelSet object, 980 casting, explicit, 859 channelSet property, 979 catalog.xml file, 158 characters, embedding ranges of, 300–302 CategoryAxis component, 667, 668 Chart Service, ColdFusion, 905 CDATA blocks, 109–110, 120 chartable values, 666 centerPopUp() method, 525 charting controls centerRadius property, 657 area charts, 666–667, 670–672 certificate, packaged AIR application, 968–969 bar charts, 666–670 certificate authority, 968 column charts, 666–670 command, 905 declaring, 650–652 tag, 894, 896 financial charts, 663–666 cfContextRoot property, 908 line charts, 666–667, 670–672 CFCs. See ColdFusion Components overview, 647–650 command, 905 pie charts, 652–662 CFEclipse, 34 Chat Rooms application, 867–871 command, 905 chatRooms.as file, 870 command, 727 ChatRooms.mxml file, 868 CFIDE/scripts/AIR folder, 907 CheckBox control, 268–269, 629–632 command, 905 child class, 15 command, 905, 907, 908 child objects CFML (ColdFusion Markup Language), 778, 880, 893 Accordion navigator container, 500 command, 905 adding to container, 148 command, 905 layout of, 78 cfPort property, 908 TabNavigator navigator container, 498 tag, 894–895 value object properties, 549–550 CFScript, 880 XML, 109 command, 607 childList argument, 525 cfServer property, 908 childrenField property, 642 cfservices.swc file, 907 chrome, operating system, 978 command, 901 chromeColor style, 355 change event class selectors, 346, 351 ButtonBar control, 611 Class variable, 284, 302, 509 ColorPicker control, 276 Class view, Flash Builder, 124 HorizontalList control, 635 classes. See also effects; specific classes by name; value objects list controls, 584, 585, 586 ActionScript, 48, 139–140, 440–441, 897 navigator bar container, 487 API documentation for, 208 989
  19. Index classes (continued) ColdFusion. See also ColdFusion Components custom, to handle unique RPC requests, 741 command, 727 custom event, 237–246 command, 607 easing, 387–388 data connections, 903–904 encapsulation, 13–14 download page, 783 formatter, 305–310 Flash Remoting, 874–878 names, 48, 67–68 Flex project, configuring for use with, 197–201 nonvisual, in MXML, 112–113 installing, 783 XML, 750–756 Network Monitor, 196–197 ClassReference() compiler directive, 453 overview, 873–875 Clean all projects option, 85 RemoteObject fault events, 900–902 Clean dialog box, 199 services, calling, 905–910 Clean option, 953 SOAP-based Web services, 778, 779–780 click event support site for, 47 addEventListener(), 225 value objects, 894–900 Button control, 209, 210, 215–216, 266–267 WSDL page generated by, 781–782 documentation for, 221, 222 ColdFusion Administrator, 905, 906 event bubbling, 228 ColdFusion Builder, 34 event listener, setting up, 223 ColdFusion Components (CFCs) LinkButton control, 268 calling from Flex application, 875 transitions, 416 creating, 878–880 click XML attribute, 210 passing arguments to, 891–894 clickHandler() method, 212, 213, 225, 228, 700–701 RemoteObject component, using with, 880–883 client-side service components, ColdFusion, 907–910 results, handling, 883–891 clone() method, 238, 240–242, 699 SOAP-based Web services, 780 close button, TitleWindow container, 527–529 ColdFusion destination, 878, 881 close event, 508, 509, 527 ColdFusion Enterprise, 855 close() method, 518 ColdFusion Event Gateway Adapter, 850 closeField property, 663 ColdFusion installation type option, 197, 875 code ColdFusion Markup Language (CFML), 778, 880, 893 generating using Flash Builder 4, 64–66 ColdFusion Web root, 876, 877 managing with Flash Builder, 124–128 ColdFusionFiles folder, 877 searching for, 58–64 ColdFusionServiceResultEvent class, 908 code completion tool Collapse Functions option, 126 camel case or hyphenated syntax in, 347 collapse value, whiteSpaceCollapse style, 258 event name constants, 226–227 collectionChange event, 862 external style sheets, 357 color style, 294, 353 overview, 79 color values, style, 362 selecting custom component, 145 ColorPicker control, 275–277, 573 triggering, 244 ColorPickerDemo.mxml file, 276 code folding, 125–127 Colors and Fonts section, Preferences dialog box, 43–44 code management, Flex versus Flash, 11 column charts, 650, 666–670 code model search tools, Flash Builder ColumnChart component, 650, 668 moving existing source-code files, 63–64 columnCount property, 292 refactoring source-code files, 63 ColumnDemo.mxml file, 292 refactoring variable names, 61–62 columnGap property, 292 searching for declaration, 60–61 columns searching for references, 60 DataGrid control, 614–619 code points, Unicode, 301 presenting text in, 292, 293 code refactoring tool, 61–62 columns property, 614, 617–618, 642 990
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2