56
Chapter 3: Using the RemotingConnector component (Flash Professional only)
Creating an instance of the RemotingConnector component
You can create an instance of the RemotingConnector component in your Flash application by
dragging it to the Stage, defining the schema, and binding the service parameters and the result to
the UI component that uses them:
To create an instance of the RemotingConnector component
1.
In the Components panel, double-click the RemotingConnector component to place an
instance on the stage.
Note:
The RemotingConnector component appears on the stage during application development
but is not visible when you execute the application.
2.
Enter the instance name of the component in the Property inspector.
3.
Modify the schema for the component on the Schema tab of the Component inspector.
You can edit this schema as needed to change the data type of the result, to add a complex,
structured result, or to provide additional formatting or validation settings. For example, you
would perform the following steps to call a service that takes two parameters (state and zip)
and returns a paged RecordSet object.
Note:
Use the Add Field button to make all modifications to the schema for the
RemotingConnector component. There is no need to use the Add Property button.
a
Select the Params : Object item in the Schema tab.
b
Select the Add Field button and set the field name property to
state
. There is no need to
change String as the default data type.
c
Select the Params : Object item again.
d
Select the Add Field button, and set the field name property to
zip
.
e
Next to the data type entry, click the Value field to activate the pop-up menu, and select
Number from the list for the data type.
f
Select the Results : Object item in the schema list, and choose RecordSet from the
drop-down menu for the data type.
g
Click the Value field next to validation options, and click the magnifying glass icon, which
appears, to bring up a dialog box for RecordSet options. Select the paging option.
4.
Using the Binding tab in the Component inspector, bind the service parameters and results that
you have defined in your schema to the UI components that will send the parameters and
display the results in your application.
5.
Use one of the following techniques to add a trigger to initiate the binding operation.
■
Attach the Trigger Data Source behavior to a button.
■
In the Actions panel, add a call on the RemotingConnector component to the ActionScript
trigger()
function.
■
Create a binding between a parameter and a UI control, and set the Kind property to
AutoTrigger. This causes a call to the
trigger()
function when a value is copied to this
location during a data binding operation. For more information, see “Schema kinds (Flash
Professional only)” in Using Flash Help.
Содержание FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT...
Страница 1: ...Using Flash Remoting for Flash MX 2004 ActionScript 2 0...
Страница 8: ...8 Contents...
Страница 62: ...62 Chapter 3 Using the RemotingConnector component Flash Professional only...
Страница 142: ...142 Chapter 7 Using Flash Remoting for Java...