1. Trang chủ
  2. » Công Nghệ Thông Tin

Flash Builder 4 and Flex 4 Bible- P21

50 351 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Deploying desktop applications with adobe air
Thể loại Hướng dẫn
Định dạng
Số trang 50
Dung lượng 480,83 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

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

Trang 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:

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

Flex Application Tips and Tricks with AIR

As described earlier in this chapter, the subject of developing Flex applications for desktop 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:

Trang 2

deploy-Part V: Additional Subjects

972

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 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

chap-Debugging AIR applications in Flash Builder

For the most part, debugging an AIR application in Flash Builder is just like debugging a 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.

Web-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:

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 nario that can result in this problem is when a runtime error occurs during execution of startup code

sce-For example, if you make a call to a server-based resource from an application-level creation

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 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 <initialWindow> element’s child <visible> 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 <visible> element, and set its value to true:

<visible>true</visible>

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:

<mx:HTML id=”myHTML” width=”100%” height=”100%”

Trang 4

Part V: Additional Subjects

private var feed:ArrayCollection;

private function resultHandler(event:ResultEvent):void {

feed = event.result.rss.channel.item as ArrayCollection;

feedSelector.selectedIndex = 0;

updateHTML();

} private function faultHandler(event:FaultEvent):void {

Alert.show(event.fault.faultString, event.fault.faultCode);

} private function updateHTML():void {

myHTML.location = feedSelector.selectedItem.link;

} protected function app_creationCompleteHandler(event:FlexEvent):void {

photosXML.send();

}

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 5

Chapter 31: Deploying Desktop Applications with Adobe AIR

Trang 6

Part V: Additional Subjects

976

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 stepsargument 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 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

navi-an error to the user.

private var myURL:String = “http://”;

private function navigate():void {

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 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;

} } ]]>

<s:Label text=”New URL:” fontWeight=”bold” fontSize=”10”/>

<s:TextInput id=”urlInput” text=”{myURL}” enter=”navigate()”/>

<s:Button label=”Go” click=”navigate()”/>

Using the WindowedApplication component

Flex applications designed for desktop deployment typically use <s:WindowedApplication>

as the application root element A beginning desktop application’s code looks like this:

<?xml version=”1.0” encoding=”utf-8”?>

<s:WindowedApplication xmlns:fx=”http://ns.adobe.com/mxml/2009”

xmlns:s=”library://ns.adobe.com/flex/spark”

xmlns:mx=”library://ns.adobe.com/flex/mx”>

Trang 8

Part V: Additional Subjects

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 cation window’s border, title bar, and control icons).

appli-l A status bar can be displayed at the bottom of the application window for string-based tus messages.

sta-Here’s one example: The WindowedApplication component can display a status bar at the tom of the application window This display is controlled by two of the WindowedApplicationcomponent’s properties:

bot-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 tion updates the application’s status bar with the title of the currently selected RSS item:

applica-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:

Trang 9

Chapter 31: Deploying Desktop Applications with Adobe AIR

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:

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:

<s:RemoteObject id=”myRO” destination=”myRemotingDestination”>

Trang 10

Part V: Additional Subjects

980

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);

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 tions and the OS

applica-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!).

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 11

Chapter 31: Deploying Desktop Applications with Adobe AIR

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 cation is packaged and delivered.

appli-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 <s:WindowedApplication> 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.

Trang 12

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 13

and Java, passing data between, 840–841looping, 119

Menu control, 494menu events, handling, 493versus MXML, 6–8MXML and, 101–103named parameters, passing, 744navigator containers, working with, 477–482objects, declaring in, 7–8

overview, 114package declarations in, 541percentage sizing, 334

to PHP data serialization, 932pie chart, 651

populating value object data with, 699

Producer component, 857

RemoteObject, 830, 882reverse domain package names, 141runtime channel, declaring in, 980serialized objects in, 862subtopics, filtering messages with, 869–870syntax, 114

text property, 255

TextFlow class, 256validating data entry with, 691–695validator object, 688

value objects, 551–552, 842–845, 895–896, 899variables, declaring, 114–117

WebService, 784, 795–796XML structure, hard-coded, 752

XMLListCollection, 755ActionScript 3.0 Language Reference, 29

actionscript adapter, 854–855, 862ActionScript class option, 238ActionScript Class Warning dialog box, 67ActionScript editor, Flash Builder, 50–51, 125–128, 180–181,

191–192ActionScript File option, 121ActionScript Virtual Machine (AVM), 99, 727, 786adapters, Message Service, 850, 854–855Add or Remove Programs option, 971

A

absolute address, 724absolute layout, 78, 133, 253, 311, 330absolute sizing, 333, 334

absolute-layout properties, Canvas container, 315abstraction layer, SOAP-based Web service, 779

acceptDragDrop() method, 395

access attribute, CFCs, 878access modifiers, 115–116, 153, 543, 582accessor methods, 539, 545–549

Accordion container, 472, 497, 500–502acompc command-line tool, 28

Acrobat PDF, 809, 955, 976–977Acrobat Reader, 976

Action Message Format See AMF Zend AMF

ActionScript 2, 99

ActionScript 3 See also E4X effects; value objects

ActionScript Virtual Machine, 99arguments, passing to remote methods, 839classes, 48, 139–140, 440–441, 897combining MXML and, 120–128complex data objects, selecting with, 607–610component methods, calling with statements, 154–155conditional statements, 117–119

Consumer component, 858–859control properties and styles, setting with, 251controlling styles with, 366–369

controls, instantiating with, 250–251custom classes, 237–242, 534, 698data collections, 554, 578data conversion from ColdFusion to, 879defined, 5

effects, declaring in, 375–377embedded fonts, declaring, 302event listener, executing single statement in, 210

fault event, 901

formatter objects, 306functions, handling events with, 211–213handling events of multiple operations, 791

HTTPService object, creating, 723

Trang 14

Index

installing, 958–959list controls for, 573LiveCycle Data Services features, 809local data, retrieving in applications, 578overview, 11, 955–956, 980–981Proxy Service, 821

remoting channels at runtime, creating, 978–980Version 2, 957

WindowedApplication component, 977–978Adobe AIR Installer application, 959

Adobe AIR Setup dialog box, 959, 971Adobe AIR Uninstaller application, 959

Adobe ColdFusion See ColdFusion

Adobe Community Help application, 29, 55–57

Adobe Creative Suite, 19, 420, 432–439 See also specific

programs by name

Adobe Developer Center Web site, 879Adobe Dreamweaver, 93–96

Adobe Fireworks, 437–439

Adobe Flash Builder 4 See Flash Builder 4

Adobe Flash Catalyst, 4, 5, 10

Adobe Flash Player See Flash Player Adobe Flex 4 See Flex 4

Adobe Flex 4 SDK Command Prompt option, 28Adobe Illustrator, 433–437, 439

Adobe Integrated Runtime See Adobe AIR

Adobe Labs Web page, 25Adobe Open Source Web site, 809, 810Adobe Photoshop, 432–433

Adobe Web siteAIR installer, 958Flash Player installation from, 24–26Flex themes, 342

FXG specifications, 420getting help from, 29LiveCycle Data Services features, 809adt command-line tool, 27

advanced text layout, 288–294

AdvancedDataGrid control, 572, 641–645 See also list

controls

AdvancedDataGridColumn control, 642

AdvDataGridDemo.mxml file, 643

AdvDataGridFlatData.mxml file, 645AeonGraphical theme, 342

afterLast property, 562

AIR, Adobe See Adobe AIR

AIR Debug Launcher (ADL), 972–973AIR file, 967, 969

airfare search application, 402–406

fault event, 734–735menu events, 493overview, 223

PopUpManager, 525

PopUpMenuButton, 518

RemoteObject component, 901removing event listener, 227

result event, 732, 833, 885setting up event listener, 223–225for single method, 791–792

void return type, 213

WebService, 785, 788

addItem() method, 555, 576

addItemAt() method, 555Additional compiler arguments section, Properties dialog

Adobe Acrobat PDF, 809, 955, 976–977Adobe Acrobat Reader, 976

Adobe AIRarchitecture of, 956–958debugging applications, 972–973desktop application, creatingapplication descriptor file, 963–967Flex project for, 960–963installing, 969–971overview, 960packaging release version of, 967–969uninstalling, 971

drag-and-drop in, 389versus Flash Player, 18HTML-based content, 973–977

HTTPService component method property, 725image types, 282

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 15

Apache Tomcat 6 See Tomcat 6, Apache

Apache Web server, 917, 918

API (application programming interface) See also Logging API

ArrayList class, modifying data with, 576–577classes, 208

controls, 250encapsulation, 13–14events, 221

app_creationCompleteHandler() function, 224–225Appearance view, Flash Builder, 54, 355

applets, 91–92

Application componentcalling Web services from, 785containership, 111–112

contentGroup property, 148custom skin for

applying with style sheet declaration, 453assigning skin, 451–452

associating with host component, 446–447creating, 444–446

FXG graphics, adding to, 449–451loading at runtime, 454–455overview, 444

skin parts, adding required, 448–449skin states, declaring required, 447–448dimensions, controlling, 130–131

layout property, setting, 131–134

MenuBar control, 496overview, 8, 128–129passing parameters, 130view states, 399application descriptor file, 963–967, 973application location, 282

application programming interface See API; Logging API

AJAX (Asynchronous JavaScript and XML), 470

Alert classbuttons, managing, 506–508CSS selectors, using with, 512–514custom graphical icon, 509–512events, handling, 508–509

fault event, 734–735, 790, 791, 792modality, controlling, 504–506overview, 503, 504

all value, creationPolicy property, 483

<allow-access-from> element, 747

allowDisjointSelection property, 273Allowed IP Addresses screen, ColdFusion Administrator, 906Allowed Services list, User Manager screen, 906

PHP, services for, 924–925

RemoteObject class, 205, 578, 830value object classes, 539

AMF0, 825AMF3, 825

AMFChannel component, 878, 979–980AMFPHP, 825, 924, 929–931

amxmlc command-line tool, 28anchors, Constraints interface, 331–332

Trang 16

Index

managing data at runtime, 556–562navigator bar container, 485overview, 552–553receiving complex messages, 862–863

source property, 554value objects, working with, 742

WebServiceresult event, 788

ArrayList classcharting controls, 649

DataGrid control, 614

getItemAt() method, 585

itemRenderer property, 629

label property, 579list controls, 575, 577modifying data with API, 576–577navigator bar container, 485–486overview, 552–553

assets folder, 164–165, 437Assets tab, New Flex Library Project wizard, 156asynchronous (nonblocking) I/O channels, 853asynchronous communications, 727

Asynchronous JavaScript and XML (AJAX), 470

order of declaration in MXML, 345value object properties, 549–550values, in MXML, 104

XML, versus child elements, 109

XML object, modifying, 765–770

auto value, creationPolicy property, 482

autoCenter Transform property, 381, 382Auto-detect the return type from sample data option, 802auto-detecting return type, 714

automatic garbage collection, 116

application property, 129Application server type drop-down menu, 75, 197, 815, 856

application servers See also specific servers by name

configuring messaging on, 851–856filtering messages on, 865–871Flash Remoting, configuring on, 877–878

HTTPService, 707, 709, 744–745supported, 46–48

Application type drop-down menu, 46, 75, 815, 856

application value, <scope> element, 829–830application window, MAMP, 917–918, 919

passing to remote methods, 838–840

Array classadding new test expressions to helper class, 770

ArrayUtil.toArray() method, 538–539data collection object source property, 554menu data providers, 492

navigator bar container, 485receiving value objects from ColdFusion, 897–898

trace() function, 172array notation, extracting data from XML objects with, 759–760

array value, resultFormat property, 726

ArrayCollection classaccessing data at runtime, 555–556bindable variable as, 731–732charting controls, 649data collection, declaring for, 553data cursors, 562–569

as data provider for PopUpMenuButton, 515

DataGrid control, 614flat data, 644

HTTPService responses, handling, 728list controls, 578

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 17

overview, 135–136

RemoteObject results, 831–832shorthand MXML, 136–137value object properties, 549, 550view state, controlling with, 407

ViewStack, setting as dataProvider, 487

WebService results, 786–787BindingUtils class, 136

effects, 385embedding images, 284–285external resource bundles, 951overview, 281–283

resizing images, 283–284Blank State option, 402

BlazeDS See also Message Service; Remoting Service

data connections, 845–847downloading, 810–811Flex projects, creating for use with, 814–816included in ColdFusion 9, 874

messaging architecture, 849overview, 807–808Proxy Service, 817–824

RemoteObject componentinstantiating, 830overview, 830passing arguments to remote methods, 838–840passing data between ActionScript and Java, 840–841remote methods, calling, 830–831

results, handling, 831–838value object classes, 841–845sample applications, 813–814sample database, starting, 813starting, 811–813

supported platforms, 808–809

BlazeDS context root folder, 816

BlazeDS WEB-INF/flex folder, 816

B

backgroundAlpha setting, 316

backgroundColor style, 128, 276, 343

backgroundFill property, 324backgrounds, pie chart, 660–662backward navigation, 478–481bar charts, 649, 666–670

BarAndColumnDemo.mxml file, 670

BarChart component, 647–648, 649, 668

BarSeries series class, 649Basic Latin character set, 301basic layout, 78, 133–134, 311, 320, 331

BasicLayout layout class, 131, 133

beans See value objects

beforeFirst property, 562

bgcolor parameter, 86bidirectional text, 292–294binary distribution, BlazeDS, 810binary files, 9

Bind to Data dialog box, 719–720, 803–804bindable properties

complex data objects, 588–589

<fx:Binding/> tag, 137–139MXML component, 150–151

result event, 731, 884value objects, 544–545XML structure, 752

[Bindable] metadata tagaccessor method properties, 548

ArrayCollection class, 553complex data objects, 588, 589making properties bindable, 138, 150value objects, 544, 551

bin-debug folder, 47, 76, 169binding expressions

bound parameters, 745ColdFusion Component results, 883–884component methods, calling with, 154external resource bundles, 952

formatter classes in, 307–308

<fx:binding> tag, 137

HTTPService responses, 728–730making expressions bindable, 137–139

Model object, 535–536, 537outputting current date, 944

Trang 18

bundleName property, 947

Button class, 208–209, 210

Button control

addEventListener(), 225custom skin, 461–467default button, 682descendant selector in, 354event bubbling, 227–228event handler for, 214, 215–216, 223exporting existing styles, 359–361

Form component, adding to, 686overview, 266–267

selectedIndex property, 478–479skin, creating new by copying default skin, 455–460trigger events, controlling validation with, 689

button controls, 266–271 See also specific controls by name

Button portion, PopUpMenuButton, 515–517

ButtonBar control See also list controls

defined, 484, 571, 572generating using dataProvider, 485–486Spark, use of, 611–613

Spark versus MX, 488vertical, 490–491

buttonWidth property, 507

C

C command, 424caching, 708, 809Cairngorm microarchitecture, 741

calculator.as file, 123–124

Calculator.mxml application, 122–123

CalculatorWithScript.mxml file, 122calendar, for date controls, 273–274Call Trace option, 173

CallAction class, 415

CallComponentMethodWithAS.mxml file, 155

callout value, labelPosition style, 652

bookmarking data, with cursors, 567–569

bound parameters, 745, 797–798Box, Don, 778

box model, CSS, 319

Box superclass, 312–313

BreakElement class, 289Breakpoint Properties dialog box, 182breakpoints

Breakpoints view, 183–185clearing, 180

conditional, 181–183Debug view, controlling application execution with, 192–194

debugging event object, 220debugging session, using in, 185–187defined, 167

inspecting variables and expressionsadding expression, 191–192Expressions view, 191Variables view, 187–188watchpoints, setting, 188–191removing, 180–181

setting, 180–181Breakpoints view, Flash Builder, 55, 183–185

“A Brief History of SOAP,” 778

bringToFront() method, 524, 525brittle applications, 12

browser, Web See Web browser

bubble charts, 649

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 19

<channels> tag, 853–854, 855

ChannelSet object, 980

channelSet property, 979characters, embedding ranges of, 300–302Chart Service, ColdFusion, 905

chartable values, 666charting controlsarea charts, 666–667, 670–672bar charts, 666–670

column charts, 666–670declaring, 650–652financial charts, 663–666line charts, 666–667, 670–672overview, 647–650

pie charts, 652–662Chat Rooms application, 867–871

chatRooms.as file, 870

ChatRooms.mxml file, 868

CheckBox control, 268–269, 629–632child class, 15

childList argument, 525

childrenField property, 642chrome, operating system, 978

chromeColor style, 355class selectors, 346, 351

Class variable, 284, 302, 509Class view, Flash Builder, 124

classes See also effects; specific classes by name; value objects

ActionScript, 48, 139–140, 440–441, 897API documentation for, 208

CallResponder class, 736–739, 794–795, 837–838

CallResponderDemo.mxml file, 739camel case, 345, 347

cancel event, 523

cancelable property, 240

cancelLabel property, 506candlestick charts, 650, 663–666

<cfpdf> command, 905

<cfpop> command, 905

cfPort property, 908

<cfproperty> tag, 894–895CFScript, 880

Trang 20

Network Monitor, 196–197overview, 873–875

RemoteObjectfault events, 900–902services, calling, 905–910

SOAP-based Web services, 778, 779–780support site for, 47

value objects, 894–900WSDL page generated by, 781–782ColdFusion Administrator, 905, 906ColdFusion Builder, 34

ColdFusion Components (CFCs)calling from Flex application, 875creating, 878–880

passing arguments to, 891–894

RemoteObject component, using with, 880–883results, handling, 883–891

SOAP-based Web services, 780

ColdFusion destination, 878, 881ColdFusion Enterprise, 855ColdFusion Event Gateway Adapter, 850ColdFusion installation type option, 197, 875ColdFusion Markup Language (CFML), 778, 880, 893ColdFusion Web root, 876, 877

ColdFusionFiles folder, 877

ColdFusionServiceResultEvent class, 908Collapse Functions option, 126

collapse value, whiteSpaceCollapse style, 258

collectionChange event, 862

color style, 294, 353color values, style, 362

ColorPicker control, 275–277, 573

ColorPickerDemo.mxml file, 276Colors and Fonts section, Preferences dialog box, 43–44column charts, 650, 666–670

ColumnChart component, 650, 668

columnCount property, 292

ColumnDemo.mxml file, 292

columnGap property, 292columns

DataGrid control, 614–619presenting text in, 292, 293

formatter, 305–310names, 48, 67–68nonvisual, in MXML, 112–113XML, 750–756

ClassReference() compiler directive, 453Clean all projects option, 85

Clean dialog box, 199Clean option, 953

click event

addEventListener(), 225

Button control, 209, 210, 215–216, 266–267documentation for, 221, 222

event bubbling, 228event listener, setting up, 223

LinkButton control, 268transitions, 416

click XML attribute, 210

clickHandler() method, 212, 213, 225, 228, 700–701client-side service components, ColdFusion, 907–910

clone() method, 238, 240–242, 699close button, TitleWindow container, 527–529

close event, 508, 509, 527

close() method, 518

closeField property, 663code

generating using Flash Builder 4, 64–66managing with Flash Builder, 124–128searching for, 58–64

code completion toolcamel case or hyphenated syntax in, 347event name constants, 226–227external style sheets, 357overview, 79

selecting custom component, 145triggering, 244

code folding, 125–127code management, Flex versus Flash, 11code model search tools, Flash Buildermoving existing source-code files, 63–64refactoring source-code files, 63refactoring variable names, 61–62searching for declaration, 60–61searching for references, 60code points, Unicode, 301code refactoring tool, 61–62

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 21

Configure Code Generation screen, 800Configure ColdFusion Server screen, 875, 877Configure ColdFusion Service screen, 903Configure Columns dialog box, 720Configure Output screen, 76–77, 960Configure PHP Server screen, 920–921Configure PHP Service dialog box, 925Configure Return Type wizard, 714–716, 802–803, 933,

934–935Confirm Perspective Switch dialog box, 185–186Connect to BlazeDS/LCDS Service dialog box, 847Connect to ColdFusion option, 903

Connect to Database button, 936Connect to Data/Service dialog box, 711, 799–800, 903–904,

933–937Connect to HTTP option, 711

connections, concurrent, 853 See also data connections

Console view, Flash Builder

DataGridtrace() statements, 622debug mode, 169–170

managing during debug session, 170–171overview, 54

trace() function messages in, 173tracing messaging traffic, 871–872constants

defined, 149encapsulation, 14event name, 226–227, 240use of, 152

whiteSpaceCollapse style, 259constraint-based layout, 330–332constraint-based sizing, 333, 335–336Constraints interface, 331–332

ConstraintSizing.mxml file, 336constructor method, 551–552, 560, 826, 843

Consumer component, 858–861, 865–871

Contact value object class, 545, 550, 744, 899

Contact[] return type, 717

ComboBox control See also list controls

complex data objects, selecting, 607–610defined, 571, 572

overview, 603

prompt property, 604–605properties, 585

selectedIndex property, 588Spark ButtonBar control, 611–613using, 605–607

ComboBoxDemo.mxml file, 607command button, 267Command design pattern, 741command window, Windows, 812

commandKey property, 220comments, in default application descriptor file, 964–967communications, asynchronous, 727

Community Help application, Adobe, 29

compareFunction property, 562compc command-line tool, 28Compile CSS to SWF option, 363–364compile time, changing locales at, 943–944Compiled Flex application location option, 47, 198compiled style sheets, 344, 363–365

compiledStyles.css file, 363

compiledstyles.swf file, 363compiler tags, MXML, 106complex data, 862–865, 929–931complex data objects, selecting, 588–590, 607–610component folder, creating, 141

component item editors, 632–634component item renderers, 597–600component libraries, 155–161component renderers, 591, 623

components See also custom components; MX components;

MXML components; programmatic skins; Spark components

custom pop-up window, 521–522view states, adding to and removing from, 408–409

in view states, managing, 412–413Components view, Flash Builder, 54, 146–147, 162composite effects, 383–387

CompWithBindableProp.mxml file, 151

CompWithPublicMethod.mxml file, 154

concatValues() method, 839

concurrency property, 723, 724, 726concurrent connections, 853

conditional statements, 117–119

Trang 22

crossdomain.xml file, 747, 817

CrossFade effect, 372

CSS (Cascading Style Sheets) See also selectors, CSS

ActionScript, controlling styles with, 366–369compiled style sheets, 363–365

custom pop-up window skin, 529custom skins, 453, 461–462embedded style sheets, 353–355external style sheets, 356–362Flex-based, 319

fonts, controlling with, 294–302

<fx:Style>, declaring style sheets with, 345HTML wrapper template, 83

inline style declarations, 344–345overview, 341–343

style sheet, defined, 343–344CSS File option, 356

CSS Namespaces Module, 347

CSSStyleDeclaration class, 367–368Ctrl key, 585, 586

ctrlKey property, 220

CurrencyFormatter class, 305, 307

CurrencyValidator class, 687

current property, 562, 564current view state, 399

currentState property, 399, 400, 406–407, 410, 412

currentTarget property, 228–229

CursorBookmark class, 567cursors, data, 562–569

curve value, form property, 672

CurvedArrow graphic, 428–430custom classes, 741

custom component item renderer, 597–600custom components

CSS type selectors, applying to, 348

dataChange event, 623–624

ContactVO class, 632–633, 897

ContactVO.as file, 843, 896

Container class, 315, 483, 498

containers, 249, 290–291, 311, 380 See also layout

containers; navigator containers; specific containers

by name

containershipdescendant selectors, 350event bubbling, 228–229MXML, 110–112overlapping element tag, 104type selector inheritance, 349

Containership.mxml file, 111content, component, 112Content Debugger Player, 21

content property

ResourceBundle class, 948richly formatted text, 288

RichText control, 289Spark text control, 255versus textFlow property, 256

whiteSpaceCollapse style, 258–259

contentBackgroundAlpha style, 355

contentBackgroundColor style, 355, 512content-based sizing, 333–334

contentGroup container, 112, 148, 252

contentGroup skin part, 448, 449, 450contract-based programming, 17control bars, Panel containers with, 329–330Control Panel, Windows, 971

ControlBar container, 311, 328–329

controlBarContent property, 129, 311, 329–330, 496,

527ControlBarDemo.mxml file, 328controller, in model-view-controller architecture, 139

controls, 249, 311, 333–336 See also layout controls; specific

controls by name; visual controls

Convert to CSS option, 360Convert to Desktop/Adobe AIR Project option, 46cookies, 470

copy() method, 756Copy non-embedded files to output folder setting, 82Copy Settings section, Workspace Launcher dialog box, 37Correct Indentation feature, 50

count() function, 937counter variable, 119Create a Flex project screen, 76–78, 961–962Create as copy of option, 528

Create Self-Signed Digital Certificate screen, 969Create Skin option, 455–456, 528

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Trang 23

conversion from ColdFusion to ActionScript, 879passing to component property, 151–152persistence of in Web applications, 470working with in Flex versus Flash, 10data collections

accessing data at runtime, 555–556

ArrayCollection, declaring, 553cursors, 562–569

dynamic data providers, 577–578managing data at runtime, 556–562overview, 533, 552–553

source property, setting, 554using as dataProvider, 485–486data connections

BlazeDS, 845–847ColdFusion, 903–904defined, 707PHP, 925, 932–938Web service, 798–805Data Controls section, Components view, 719data elements, in custom event classes, 237, 240data entry controls, 271–277

data entry formscustom Form components, 683–687

Form container, 676–683overview, 675–676sharing data with application, 697–704validating data entry, 687–697

data folder, 783Data Management Service, 614, 631, 809data model, 533–539

data points, pie chart, 652

data propertyitem renderer, 623list controls, 595, 597, 598

Path class, 423–424, 425data providers

dynamic, 577–578hard-coded, 575–577

inheritance, 349managing view states in, 412–413

in navigator containers, 472–473custom constructor methods, 551–552custom drag-and-drop operations, 391–398custom event classes

creating in ActionScript, 238–242dispatching, 242–244

handling event using, 244–246overview, 237–238

custom eventsdeclaring, 231–233dispatching, 233–235, 699–704handling, 235–237

overview, 230–231custom Form components, 683–687custom function, 211–212custom graphical icon, pop-up window, 509–512custom item renderers

component, 597–600drop-in, 591–593inline, 593–597overview, 590–591Spark, customizing with view states, 600–602custom label function, 653–654

custom namespace prefix, 144, 549custom perspective, Eclipse, 42custom pop-up windows, 503, 521–529custom resource bundles, 947–953Custom section, Components view, 146, 162custom skins

binding to component, 451–455for other Spark componentsassigning with CSS, 461–462creating new skin, 455–460customizing skin, 462–467overview, 444

for Spark Application componentassociating with host component, 446–447creating, 444–446

FXG graphics, adding to, 449–451overview, 444

skin parts, adding required, 448–449skin states, declaring required, 447–448

Trang 24

DataGrid control, 615, 616menu control, 493, 494overview, 571pie charts, 649

PieSeries series class, 659

ViewStack, using as, 487–488

DataSeries class, 652Data/Services view, Flash Builder, 712, 714, 715, 847, 933date application, 943–944

Date class, 945date controls, 273–275

debug() method, 176debug mode, Flash Builder, 169–172debug version

Flash Player, 21–22, 24, 25–26, 168Flex application, 88, 169

Debug view, Flash Builder, 54, 190Debugger menu item, 168

debugging See also breakpoints

Adobe AIR applications, 972–973custom formatting function, 622debug mode, running application in, 169–172debug version of application, 169

event objects, 220–221logging, 172–180Network Monitor, 196–206overview, 167–169profiling tools, 194–196debugging views, Flash Builder, 54–55

Declarations tag, 178

data providers (continued)

menu controls, 492–493overview, 574

PopUpMenuButton control, creating for, 514–515data serialization, 840–841, 932

data series, for charts, 649, 652, 659–660, 666data set, returning from PHP class, 929–930Data Transfer Object pattern, 841

data transfer objects See value objects

data types, 362, 539Data Visualization components, 4, 27, 641, 648databases, 534, 813, 935–938

data-centric applicationsbinding returned data to visual controls, 719–722data connections, 710–714

overview, 707, 710return data type, defining, 714–719

dataChange event, 623–625

data/contacts.xml expression, 724

dataField property, 617, 619, 621

dataForFormat() method, 395

DataGrid control See also list controls

binding data to, 803–804binding returned data to visual controls, 719–720custom components in navigator container, 473custom labels, displaying, 619–622

customizing display, 614–619

dataChange event, 623–625defined, 572

drag-and-drop support, 390financial charts, 664–666handling HTTPService responses, 728, 729–730item editors, 627–628

itemRenderer property, 629–632numeric data, 647–648

overview, 613–614Spark item renderers, 626

DataGridColumn controlcontrolling column display, 617–619displaying custom labels, 619–621drop-in item editors, 628–629dynamic data field, 621item renderers and editors, 622–623label properties, 583

Spark item renderers, 626–627

Trang 25

Flash Remoting, 878Message Service, 855–856Proxy Service, 818–824Remoting Service, 828–830detached view, Eclipse, 39–40

detail property, 508Developer edition, ColdFusion, 875development, Flex versus Flash, 8–11development tools, 26–28

device fonts, 295–296DHTML (Dynamic HTML), 210Digital Signature screen, Export Release Build wizard,

968–969

dimensions See also sizing containers and controls

controlling application, 130–131navigator containers, 484

ViewStack, 477

direction propertybidirectional text, 293

Box superclass, 312

FormItem container, 681

LinearGradient class, 426navigator bar container, 488Spark ButtonBar component, 490

disabled skin state, 448

disabledDays property, 275

disabledRanges property, 275disabling validation trigger events, 691–692Disconnect tool, 193

dispatchEvent() method, 234, 238

displayAsPassword property, 260

DisplayBookCollection.mxml file, 556distribution, Eclipse, 35

div element, textFlow property, 256

<div> tag, 83, 85, 92

DivElement class, 289docked view, Eclipse, 39–40Document Class feature, 66, 70Document Object Model (DOM), 750–751, 785

document property, 785Document Service, ColdFusion, 905documentation

CFC, 881, 882ColdFusion, 910

declarative instantiation, 250deep linking, 87–88default application descriptor file, 964–967default argument values, instantiating value objects with, 552

default attribute, 855, 895default button, 507–508, 681–683default columns display, DataGrid control, 615–616default destination, Proxy Service, 818–822

default dimensions, content-based sizing, 333default skin, creating custom skin by copying, 455–460default values, value object class properties, 539

defaultButton property, 682, 683

<default-channels> tag, 856

DefaultHTTPid, 819

DefaultProxyDestination.mxml file, 822, 823deferred instantiation, 483, 614

DELETE method, 725

delete operator, 766–767

deletePerson() function, 937deploying Flex applicationscreating release build, 88–90deploying release build, 91integrating into existing Web page, 91–92integrating with Dreamweaver, 93–96testing release build, 90–91deployment, BlazeDS, 818derived class, 15descendant accessor operator, 760descendant selectors, CSS, 346, 350–351, 354

DescendantSelectorDemo.mxml file, 351

descending property, 560

descriptor-template.xml file, 963design, with Flex versus Flash, 10Design view

constraint properties, 332constraint-based layout, 331–332event handler function, generating, 215–216Flash components, 162–163, 165

inserting custom component instance in, 146–149MXML editor, 49–50

view states, defining in, 401–406views used in, 54

Desktop application option, 46

desktop applications See Adobe AIR

desktop deployment, Flash Player, 18destination, binding expression, 136

destination property

Consumer component, 858

Producer component, 857

Ngày đăng: 24/10/2013, 20:15

TỪ KHÓA LIÊN QUAN