User Guide
Data connectivity (Flash Professional only) 277
To add, edit the name of, or remove a web service:
1.
Click Define Web Services (the planet icon at the top of the panel).
2.
To add a service, click Add Web Service, and enter the URL of the web service. Double-click
an existing web service to edit its name, or select a service and click Remove to remove it.
If you want to edit a WebServiceConnector component’s schema, you can edit it from the
Schema tab of the Component inspector.
Note: Access to a web service (as with any external data) is subject to Flash Player security features.
For more information, see “About data connectivity and security in Flash Player” on page 279.
Connecting to XML data with the XMLConnector component (Flash
Professional only)
The XMLConnector component lets you access any external data source that returns or receives
XML through HTTP. A single instance of an XMLConnector component can be used to make
multiple calls to the same operation. To call more than one operation, use a different instance of
an XMLConnector component for each operation. For example, you would use one instance to
connect to a DataSet component and another instance to connect to a resolver component, as
shown in the illustration in the overview at the beginning of this chapter.
To use the XMLConnector component, you load a sample of your XML document’s schema into
the component. The schema is the structure of the XML document that identifies the data
elements in the document to which you can bind.
To load the schema, you import a sample of the XML data to which you’re connecting. You can
either use an actual sample of real data or, if you know XML scripting, create a sample yourself.
You import that sample XML file using the Component inspector.
Be sure that the sample you use contains all the elements you want for data binding and
accurately represents the real data. Different XML structures result in different schemas. For
example, if your sample contains an array with only one item, Flash won’t know that you need an
index for that array. The array needs to contain at least two items.
To import a sample schema:
1.
Locate the XML file to use as a sample.
2.
Drag an XMLConnector component to the Stage.
3.
Click the Parameters tab in the Component inspector and for the URL parameter, specify the
fully qualified name of the XML data source.
4.
Click the Schema tab in the Component inspector and select params or results, as
appropriate. Select
results if the XML sample represents the schema of the results of a call to
the data source.
5.
Do one of the following to import the schema:
■ Click the Import Sample Schema button in the upper right corner of the Schema tab.
■ Click the options menu control in the upper right corner of the Component inspector and
select Import XML Schema from the menu.