Creating A Simple Application - MACROMEDIA FLASH 8-USING FLASH Use Manual

Using flash
Table of Contents

Advertisement

Creating a simple application

The following example walks you through creating a simple data integration application,
which can help you understand the concepts and steps involved.
In the example, you create a simple application that loads and displays a dinner menu. You
load an XML file, which you'll use both as a data source and as a sample of the data source's
schema (structure). The UI consists of a data grid, into which the XML data is loaded, and a
button that loads the data. Data binding is supported only between components that exist in
Frame 1 of the main Timeline, Frame 1 of a movie clip, or Frame 1 of a screen; in this
example, the components all reside in Frame 1 of the main Timeline.
Note that all of the namings in this example are case-sensitive.
To create the dinner menu application:
1.
Copy the data source, an XML file called dinner_menu.xml, from following location:
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\DataIntegration\DinnerMenu\
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/
Samples and Tutorials/Samples/DataIntegration/DinnerMenu/.
2.
In Flash, create a new Flash document and save it as dinner_menu.fla in the Dinner Menu
folder you created in step 1.
3.
Create the user interface, which consists of two components—a button that triggers data
retrieval and a data grid to display the data:
a.
From the Components panel, add a DataGrid instance named
with width 540 and height 240.
b.
Also from the Components panel, add a Button component instance named
below the data grid labeled Load Data.
loadData
4.
Add the data components—an XMLConnector component to connect to the
dinner_menu.xml file and a DataSet component to bind that data to the data grid:
a.
Add an XMLConnector component instance named
b.
Add a DataSet component instance and name it
The data components do not have to be on the Stage; they don't appear at runtime.
5.
Set parameters for the XMLConnector component: select the XMLConnector component
instance and, in the Component inspector, click the Parameters tab, enter
dinner_menu.xml
XML file is in the same folder as the FLA file, the fully qualified path is simply the
XML filename.)
for the URL, and select
xmlConn
.
menu_ds
for the direction. (Because the
receive
Creating a simple application
to the Stage
menu_dg
.
391

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-USING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF