Detailed instructions for use are in the User's Guide.
[. . . ] Data Tutorials
Trademarks Add Life to the Web, Afterburner, Aftershock, Andromedia, Allaire, Animation PowerPack, Aria, Attain, Authorware, Authorware Star, Backstage, Bright Tiger, Clustercats, ColdFusion, Contribute, Design In Motion, Director, Dream Templates, Dreamweaver, Drumbeat 2000, EDJE, EJIPT, Extreme 3D, Fireworks, Flash, Flash Lite, Flex, Fontographer, FreeHand, Generator, HomeSite, JFusion, JRun, Kawa, Know Your Site, Knowledge Objects, Knowledge Stream, Knowledge Track, LikeMinds, Lingo, Live Effects, MacRecorder Logo and Design, Macromedia, Macromedia Action!, Macromedia Breeze, Macromedia Flash, Macromedia M Logo and Design, Macromedia Spectra, Macromedia xRes Logo and Design, MacroModel, Made with Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Open Sesame!, Roundtrip, Roundtrip HTML, Shockwave, Sitespring, SoundEdit, Titlemaker, UltraDev, Web Design 101, what the web can be, and Xtra are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] The results should look similar to the following graphic:
Select Dreamweaver and click the Get Tip button again to view another tip.
10
Web Service Tutorial: Macromedia Tips (Flash Professional Only)
XML Tutorial: Timesheet (Flash Professional Only)
In this tutorial, you will create an application for editing timesheet data. The timesheet data is stored as XML within a native XML database. The XUpdateResolver component is the best choice for this type of application, because it generates XUpdate statements that can be sent to the server to update the data. You will complete the following tasks:
· "Create the user interface" on page 12 · "Edit the data" on page 16
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 realworld applications. In fact, Macromedia does not recommend using public web services directly from within any client-side application. For more information, see "About data connectivity and security in Flash Player" in the "Data Integration" chapter in Using Flash (in Flash, select Help > Using Flash).
For this tutorial, you will need to download the Data Tutorials ZIP file from www. macromedia. com/go/flmx2004_data_tutorials. The ZIP file contains the data. xml file you use in the tutorial. This is accomplished by selecting an item within the Schema Tree pane and modifying its settings.
7. This is because the Flash authoring tool
cannot determine that it is a date type based on its value. You need to give it some additional information to encode this value correctly.
8. Select the Data Type parameter for the Date schema field and change it to Date. This tells the
DataBinding component to try to work with this value as a date.
For more information on data binding and data types, see "Schema data types" in the "Data binding" section of the "Data Integration" chapter in Using Flash (in Flash, select Help > Using Flash).
9. Select the encoder parameter for the Date schema field and change it to Date. Select the encoder
options parameter and select the value "MM/DD/YYYY". This tells the DataBinding component how the string value is represented in the XML file. With this information, the DataBinding component can successfully take any string in this format and convert it into an ActionScript date object.
For more information on data binding and encoders, see "Schema encoders" in the "Data binding" section of the "Data Integration" chapter in Using Flash (in Flash, select Help > Using Flash).
Create the user interface
13
10. Select the @billable schema field.
Notice that the field's data type was automatically set to Boolean by the authoring tool, which looks for certain patterns to guess the type of an XML element. However, you need to modify the Encoder Options for the field. For Boolean data types, the encoder options specify strings that indicate true and false values.
11. With the @billable schema field still selected, double-click the Encoder Options field. In the Boolean Encoder dialog that appears, enter true in the String That Mean True text box
and enter false in the Strings That Mean False text box.
13. [. . . ] 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.
5. 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. [. . . ]