Download Print this page

Advertisement

Data Tutorials

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

Summary of Contents for MACROMEDIA FLASH MX 2004-DATA

  • Page 1 Data Tutorials...
  • Page 2 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.
  • Page 3: Table Of Contents

    CONTENTS Web Service Tutorial: Macromedia Tips (Flash Professional Only) ..........5 Connect to a public web service .
  • Page 4 Contents...
  • Page 5: Web Service Tutorial: Macromedia Tips (Flash Professional Only)

    (Flash Professional Only) In this tutorial, you use the Web Services panel to connect to a web service, which you use to return a random tip about Macromedia software. You then use components to set up a simple user interface.
  • Page 6 . The parameter is a string that tells the web service what product Macromedia product you want to see a tip for. In the next step, you bind this parameter with a ComboBox instance in your application. Right-click the...
  • Page 7: Create A User Interface And Bind The Components With The Web Service

    Next, you use components to create a simple user interface that you can use to select a product, click a button, and see a random tip about the product. You create this application by binding the user interface components on the Stage to the parameter and results in the Macromedia Tips web service.
  • Page 8 Instance name tip_lbl and in the text field type Tips. Now add a binding for the WebService connector component from the Macromedia Tip service to ComboBox component that allows the user to choose a product and return a tip about the product.
  • Page 9 In the Component inspector, double-click the empty value in the Bound To field. In the Bound To dialog box, select for the component path and ComboBox, <products_cb> value:String for the schema location. Then click OK. Bound To field in the Component inspector Selecting the component path and schema location in the Bound To dialog box Next, you will bind the parameter in the web service connector to the TextArea...
  • Page 10 Test the application (Control > Test Movie). Select Flash from the ComboBox instance and click the Get Tip button. The results should look similar to the following graphic: Select Dreamweaver and click the Get Tip button again to view another tip. Web Service Tutorial: Macromedia Tips (Flash Professional Only)
  • Page 11: Xml Tutorial: Timesheet (Flash Professional Only)

    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 more information, see “About data connectivity and security in Flash Player”...
  • Page 12: Create The User Interface

    Create the user interface You will begin by creating a user interface, which displays the information in the XML file. Create a new Flash document using Flash MX Professional 2004. Make sure your computer is connected to the Internet. From the Components panel, drag an XMLConnector component to the Stage. In the Property inspector, enter the instance name timeInfo_con.
  • Page 13 Note: The XMLConnector component stores information internally as strings. When a request is made for the data through a DataBinding component, you can define how the string data is converted into the correct ActionScript types. This is accomplished by selecting an item within the Schema Tree pane and modifying its settings.
  • Page 14 Select the schema field. @billable 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.
  • Page 15 Note: The field names must exactly match the names of their corresponding properties within the XMLConnector component (@date = date, @billable = billable, @duration = duration), including capitalization. Select the Date field that you just created. Select the encoder setting and change it to DateToNumber.
  • Page 16: Edit The Data

    Edit the data Now you will modify the application so that you can edit data through the DataGrid component. On the Stage, select the DataGrid component. Then click the Parameters tab in the Component inspector. Set the property to editable true Run the application.
  • Page 17: Xupdate Tutorial: Update The Timesheet (Flash Professional Only)

    Note: The use of a public web service in this tutorial in no way implies 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 more information, see “About data connectivity and security in Flash Player”...
  • Page 18: Update The Timesheet

    Update the timesheet Begin with the file you created in the “XML Tutorial: Timesheet (Flash Professional Only)” Drag an XUpdateResolver component to the Stage, and in the Property inspector enter the instance name timeInfo_rs. Click the Schema tab in the Component inspector, and select the component deltaPacket property within the Schema Tree pane.
  • Page 19 Click the Show Updates button. Review the XML packet in the TextArea component. Tip: You can copy the XML data into your favorite XML editor to make it easier to read. Try setting the parameter of the XUpdateResolver component to includeDeltaPacketInfo using the Component inspector.
  • Page 20 XUpdate Tutorial: Update the Timesheet (Flash Professional Only)

This manual is also suitable for:

Flash mx 2004 - actionscript