What is Software? | What is Education? | What is Technology? | What is Research? | What is Wi-Fi? | What is Communication? | What is Customer Service?

Free SEO Tutorials & Help

Tutorials:   Adobe Flash   Adobe Photoshop   CorelDRAW   SEO  

Site Map

Website Development | Cable & Broadband Magazine | Solutions for Higher Education | Auction Anything Online

Adobe Flash Help & Tutorials

 Back to Topics

 

What is Data Integration: Using XUpdate to Update the Timesheet (Flash Professional Only)

Data Integration: Using XUpdate to Update the Timesheet
(Flash Professional Only)

Update the timesheet

Data Integration: Using XUpdate to Update the Timesheet (Flash Professional Only)

TOP

Prerequisite: Data Integration: Using XML for a Timesheet (Flash Professional Only)

This tutorial starts where the Data Integration: Using XML for a Timesheet (Flash Professional Only) tutorial left off. Now that the DataSet component is managing the data, it is tracking changes that are made to the data into the DeltaPacket property. A resolver is needed to send the changes back to the server in an optimized way. The XUpdateResolver component is the best choice for updating an XML source, because it generates XUpdate statements that can be sent to the server to update the data.

In this tutorial, you will complete the following task:

Update the timesheet

This tutorial uses a public web service and therefore requires that you have an Internet connection. In addition, the tutorial won't work in a browser because of sandbox restrictions, but will work in the Flash authoring environment or Flash Player.

NOTE The use of a public web service in this tutorial does not imply that you should use one for real-world applications. In fact, Macromedia does not recommend using public web services directly from within any client-side application.

For this tutorial, you will need to the data.xml file provided in the Tutorial Assets folder. This file can be found in one of the following locations:

  • In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and Tutorials\Tutorial Assets\Data Integration\Using XML for a Timesheet\data.xml

  • On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/Tutorial Assets/Data Integration/Using XML for a Timesheet/data.xml

NOTE For demonstration purposes, you will access the XML data from your hard disk and display the DeltaPacket property within your screen. In the real world, the XUpdate would be sent to the server for processing.

 

Update the timesheet

#TOP

Now you will set up the bindings to allow the timesheet to be updated.

  1. Begin with the file you created in the Data Integration: Using XML for a Timesheet (Flash Professional Only) tutorial.

  2. In the Components panel, open the Data category and drag an XUpdateResolver component to the Stage.

  3. In the Property inspector, enter the instance name timeInfo_rs.

  4. Click the Schema tab in the Component inspector, and select the deltaPacket component property within the Schema Tree pane.

  5. Change the DeltaPacket component's encoder setting to DataSetDeltaToXUpdateDelta.

    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.

  6. Double-click the encoder options property. When prompted for a value for the rowNodeKey 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.

    In the sample XML file, the id attribute of the datapacket/row node is the unique identifier, and it will be mapped to the DataSet component's ID schema field. This is defined with the following expression:

    datapacket/row[@id='?id']

  7. In the Component inspector, click the Bindings tab.

  8. Click the Add Binding button.

  9. In the Add Binding dialog box, click the deltaPacket property and click OK.

  10. In the Component inspector Bindings tab, double-click the Bound To property.

  11. In the Bound To dialog box, click the Data Set component, and then click the deltaPacket schema location and click OK.

    This 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 applyUpdates() method is called.

  12. Drag a TextArea component onto the Stage, and in the Property inspector enter the instance name deltaText.

  13. Still in the Property inspector, set the Width to 360.

  14. Select the component, and then in the Component inspector, click the Bindings tab.

  15. Click the Add Binding button.

  16. In the Add Binding dialog box, click the text: String property and click OK.

  17. In the Bindings tab, double-click the Bound To property.

  18. In the Bound To dialog box, click the XUpdateResolver component, and then click the xupdatePacket schema location and click OK.

    The update packet contains the modified version of the DeltaPacket that will be sent to the server.

  19. In the Components panel, open the User Interface category and drag a Button component onto the Stage.

  20. In the Property inspector, enter the instance name btn_show. In the Component inspector, click the Parameters tab and change the label to Show Updates.

  21. With the button selected, open the Actions panel (F9) and enter the following code:

    on (click) {

    _parent.timeInfo_ds.applyUpdates();

    }

  22. Test the application (Control > Test Movie). Load the data and make a change to one or more fields in multiple records.

  23. Click Show Updates. Review the XML packet in the TextArea component.

    TIPYou can copy the XML data into your favorite XML editor to make it easier to read.

  24. Try setting the includeDeltaPacketInfo parameter of the XUpdateResolver component to true using the Component inspector.

    NOTE Additional information is added to the update packet. This information can be used by the server to uniquely identify this update operation. With this information, the server can generate a result packet that can be used by the XUpdateResolver component and the DataSet component to update the client data with changes from the server.

 

Copyright ADOBE - All Rights Reserved Worldwide

 

 

More Topics:

Working with Flash Documents

How to work in Flash WorkSpace

Working with Projects in Flash

Process to Build your First Application in Flash

Using Symbols, Instances and Library Assets in Flash

How to Build Video Player in Flash

How to Work with Color, Strokes and Fills in Flash

How to Create Document in Flash

What is Vector and Bitmap Graphics in Flash

How to Create a Banner in Flash, Part 1

How to Work with Text in Flash

How to Create a Banner in Flash, Part 2

How to Use Imported Artwork in Flash

How to Create a Banner in Flash, Part 3

How to Work with Graphic Objects in Flash

How to Work with Layers in Flash

How to Use Filters and Blends

Working with Graphics in Flash

What is Accessibility Features in Flash

How to Create Motion (Shape Tween & Motion Tween) in Flash

How to Create an Application in Flash

What is Masking in Flash

How to Work with Video in Flash

How to Use Layout Tools in Flash

What are Behaviors in Flash

How to Work with Sound in Flash

How to Create Symbols and Instances in Flash

What is ActionScript in Flash

How to Write ActionScript With Script Assist in Flash

How to Add Button Animation and Navigation in Flash

What is Data Integration in Flash

How to Work with Screens

How to Create a Presentation with Screens

What is Extending Flash

How to Create Multilanguage Text in Flash

How to Create Graphics: Draw in Flash

What is Flash Lite

Ways of Data Integration

How to Create Graphics: Create a Timeline Animation in Flash

Getting Started with Flash Lite in Flash

How to Publish Flash Documents

How to Create Graphics: Making Animations with Easing

Learning Flash Lite 1.X ActionScript in Flash

How to Export Flash Content and Images from Flash

How to Create Graphics: Applying Gradients in Flash

Process of Writing and Editing ActionScript 2.0 in Flash

How to Create Accessible Content in Flash

How to Create Graphics: Apply Graphic Filters and Blends

What is Data and Data Types in Flash

Process of Printing from SWF Files in Flash

Using ActionScript: How to Use Script Assist mode in Flash

Learn Syntax and Language Fundamentals in Flash

How to Create E-learning Content in Flash

Using ActionScript: How to Write Scripts in Flash

Working with Functions and Methods in Flash

Process of Using Templates in Flash

Using ActionScript: Process of Adding Interactivity in Flash

What are Classes in Flash

Control Tag Summary of XML to UI in Flash

Using ActionScript: How to Create a Form with Conditional Logic and Send Data in Flash

What is Inheritance in Flash

What is Data Integration: Overview

Using ActionScript: How to Work with Objects and Classes in Flash

Overview on Interfaces in Flash

What is Data Integration: Using XML for a Timesheet

How to Work with Text and Strings in Flash

How to use Handling Events in Flash

What is Data Integration: Using XUpdate to Update the Timesheet

Learning Animation, Filters and Drawings in Flash

How to Work with Movie Clips in Flash

How to Create Interaction with ActionScript in Flash

How to Work with Images, Sound, and Video in Flash

How to Work with External Data in Flash

What is Security in Flash

How to Debug Applications in Flash

List of Error Messages in Flash

Using Object-Oriented Programming with ActionScript 1.0 in Flash

How to Write Scripts for Earlier Versions of Flash Player in Flash

List of all Keyboard Keys and Key Code Values for using in Flash

Terminology

Introduction to Components in Flash

What are Components in Flash

How to Create an Application with Components

How to Work with Components in Flash

How to Handle Component Events in Flash

How to Customize Components in Flash

How to Create Components in Flash

What is Collection Properties in Flash