Download Print this page

Update The Timesheet - MACROMEDIA FLASH MX 2004-DATA Tutorials Manual

Advertisement

Update the timesheet

Begin with the file you created in the "XML Tutorial: Timesheet (Flash Professional Only)"
1.
Drag an XUpdateResolver component to the Stage, and in the Property inspector enter the
2.
instance name timeInfo_rs.
Click the Schema tab in the Component inspector, and select the
3.
property within the Schema Tree pane.
Change the DeltaPacket component's encoder setting to DataSetDeltaToXUpdateDelta.
4.
This encoder converts data within the DeltaPacket into XPath statements that are supplied to
the XUpdateResolver component, but it needs additional information from you to do its job.
Double-click the
5.
property, type datapacket/row[@id='?id']
This property identifies which node within the XML file will be treated as a record within the
data set. It also defines which element or attribute combination makes the row node unique, as
well as the schema field within the DataSet component that will represent it. See
"DataSetDeltaToXUpdateDelta encoder" in the "Data Integration" chapter of Using Flash
(in Flash, select Help > Using Flash).
In the sample XML file, the
and it will be mapped to the DataSet component's ID schema field. This is defined with the
following expression:
datapacket/row[@id='?id']
In the Component inspector, click the Bindings tab. Add a binding from the XUpdateResolver
6.
component's
binding will copy the DeltaPacket component to the XUpdateResolver component so that it
can be manipulated before it is sent to the server.
Note: The data is copied after the DataSet component's
Drag a TextArea component to the Stage, and in the Property inspector enter the instance name
7.
deltaText. Select the component, and then in the Component inspector, click the Bindings tab.
Add a binding from the TextArea component's
component's
DeltaPacket that will be sent to the server.
Drag a Button component onto the Stage, and in the Property inspector enter the instance
8.
name btn_show. In the Component inspector, click the Parameters tab and change the label to
Show Updates.
With the button selected, open the Actions panel (F9) and enter the following code:
9.
on (click) {
_parent.timeInfo_ds.applyUpdates();
}
Test the application (Control > Test Movie). Load the data and make a change to one or more
10.
fields in multiple records.
18
XUpdate Tutorial: Update the Timesheet (Flash Professional Only)
encoder options
attribute of the datapacket/row node is the unique identifier,
id
property to the DataSet component's
deltaPacket
property. The update packet contains the modified version of the
xupdatePacket
property. When prompted for a value for the
.
applyUpdates()
property to the XUpdateResolver
text
component
deltaPacket
rowNodeKey
property. This
deltaPacket
method is called.

Hide quick links:

Advertisement

loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-DATA and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx 2004 - actionscript