Foundation XML for Flash

Chapter 1: Flash and XML

Figure 1-1: A Flash photo gallery application that uses content from an XML document
Figure 1-2: A ticker-style Flash photo gallery application
Figure 1-3: Global airport weather information displayed in a Flash movie with content from a web service
Figure 1-4: An interactive periodic table created in Flash, XML, and webMathematica
Figure 1-5: The Excel workbook structure for Dura-lite parts
Figure 1-6: The Flash catalog for Dura-lite parts
Figure 1-7: An XML document from Moreover news
Figure 1-8: Moreover news headlines displayed in a Flash movie
Figure 1-9: An XML document containing a list of MP3 files generated by an ASP.NET file
Figure 1-10: An MP3 player that uses an XML document listing the MP3 files
Figure 1-11: Exporting XML data from an Excel spreadsheet
Figure 1-12: Dura-lite uses a web interface to upload their new XML files.
Figure 1-13: The same Flash movie can be used to access multiple sources of information.
Figure 1-14: The same source of information can be used with different Flash movies.
Figure 1-15: A learning object about understanding Chinese and Japanese characters

Chapter 2: Introduction to XML

Figure 2-1: The character map in Windows displaying the small letter e with an acute accent
Figure 2-2: The hierarchy of elements within the phone book XML document
Figure 2-3: An XML document opened in Internet Explorer
Figure 2-4: Internet Explorer displaying a document that isnt well formed
Figure 2-5: A document that is not well formed displayed in XMLSpy
Figure 2-6: An XML file open in Firefox
Figure 2-7: After installing the Internet Explorer XML tools, you can right click in the browser window to validate the XML or view XSL output.
Figure 2-8: The DOM Inspector in Firefox
Figure 2-9: An HTML file displayed in Internet Explorer
Figure 2-10: The sample SVG document displayed in Internet Explorer

Chapter 3: XML Documents

Figure 3-1: Saving an XML document in Notepad
Figure 3-2: Options available when creating a new document with XMLSpy
Figure 3-3: When you create a new XML document, XMLSpy prompts for a DTD or schema reference.
Figure 3-4: When a schema or DTD is referenced, XMLSpy displays information about the selected element or attribute. Entry Helpers are included on the right side of the screen.
Figure 3-5: Using XMLSpy to check whether a document is well formed
Figure 3-6: Checking validity in XMLSpy
Figure 3-7: A transformed XML document in XMLSpy
Figure 3-8: XML content generated by a server-side file, displayed in Internet Explorer
Figure 3-9: Using Save as type to generate an XML document
Figure 3-10: The XML Toolbox toolbar in Word 2003
Figure 3-11: The WordprocessingML viewer in Word 2003
Figure 3-12: Entering schema settings in Word 2003
Figure 3-13: Attached schemas in Word 2003
Figure 3-14: The content marked up in Word 2003
Figure 3-15: The completed template in Word 2003
Figure 3-16: Youll see this warning when saving in XML format with a schema in Word 2003.
Figure 3-17: Excel 2003 asks how an XML file should be opened.
Figure 3-18: An XML document displayed in Excel 2003
Figure 3-19: The XML Map Properties dialog box in Excel 2003
Figure 3-20: The original and updated XML documents open in XMLSpy
Figure 3-21: Excel 2003 will create a document map for an XML file if a schema doesnt exist.
Figure 3-22: An XML file without a schema imported into Excel 2003
Figure 3-23: An XML document with mixed elements doesnt display correctly in Excel 2003.
Figure 3-24: Exporting a table in Access 2003
Figure 3-25: Export options in Access 2003
Figure 3-26: Export options in Access 2003
Figure 3-27: Schema export options in Access 2003
Figure 3-28: Presentation export options in Access 2003
Figure 3-29: The relationships between tables in the documents.mdb database
Figure 3-30: Internet Explorer showing an XML document transformed with CSS
Figure 3-31: Internet Explorer showing the XSLT file
Figure 3-32: The transformed XML file in Internet Explorer
Figure 3-33: The XSL output in Internet Explorer.
Figure 3-34: Mapping elements from the source tree to the result tree
Figure 3-35: The transformed XML file in Internet Explorer
Figure 3-36: The file addressDTD.xml contains an inline DTD, which can be used to validate the contents in XMLSpy.
Figure 3-37: The data structure for the photo gallery
Figure 3-38: The complete file photoGallery.xml displayed in XMLSpy
Figure 3-39: The complete file photoGallerySchema.xml displayed in XMLSpy

Chapter 4: Using the XML Class

Figure 4-1: The Output window displaying the status property
Figure 4-2: The Output window displaying XML content
Figure 4-3: The Output window displaying an error message
Figure 4-4: Tracing an element from the document tree
Figure 4-5: Displaying the root node name
Figure 4-6: Displaying the child node names
Figure 4-7: Displaying the contents of an XML document using a recursive function
Figure 4-8: Displaying the previous and next sibling node names
Figure 4-9: Displaying the parent node name
Figure 4-10: Looping through the attributes collection
Figure 4-11: The gallery.fla interface
Figure 4-12: Testing that the XML document has been loaded into Flash
Figure 4-13: Testing that the ComboBox component has been populated
Figure 4-14: Testing the ComboBox listener
Figure 4-15: Testing the loadPhoto function
Figure 4-16: Testing that the first image loads
Figure 4-17: The folder structure for my MP3s
Figure 4-18: The MP3s movie interface
Figure 4-19: Displaying the page MP3List.aspx in a web browser
Figure 4-20: Testing that the XML content has been loaded into Flash
Figure 4-21: Testing the ComboBox component
Figure 4-22: Testing the ComboBox listener
Figure 4-23: Testing that the List component is populated correctly
Figure 4-24: Tracing the song file name
Figure 4-25: Tracing the root node when the full server path has been omitted
Figure 4-26: Displaying the contents of the XML object
Figure 4-27: Displaying the contents from an XML object created in Flash
Figure 4-28: Displaying the XML document tree
Figure 4-29: Displaying the XML document tree, including a text node
Figure 4-30: The completed example
Figure 4-31: The Output window showing an attribute
Figure 4-32: The document tree including XML and DTD declarations
Figure 4-33: The document tree including style sheet and schema declarations
Figure 4-34: Displaying the XML declaration and root node
Figure 4-35: Displaying the contact nodes and attributes
Figure 4-36: Displaying the finished XML file
Figure 4-37: Displaying the first <name> element before and after the change
Figure 4-38: Displaying the <contact> element before and after the change
Figure 4-39: Displaying changes to the <name> element
Figure 4-40: Displaying the cloned <contact> element
Figure 4-41: Displaying the last <contact> element in the document tree before and after the deletion
Figure 4-42: The galleryupdate.fla interface
Figure 4-43: Displaying the new <photo> node
Figure 4-44: The form providing input for the new <photo> node
Figure 4-45: A web browser displaying XML sent from Flash
Figure 4-46: Displaying the server-side XML reply in Flash
Figure 4-47: Displaying the galleryXMLupdate.fla interface
Figure 4-48: Displaying the form details
Figure 4-49: Displaying the response in Flash
Figure 4-50: Displaying theupdated file in XMLSpy

Chapter 5: Working with XML in Word 2003

Figure 5-1: Opening an existing XML document in Word
Figure 5-2: Selecting an XSL style sheet
Figure 5-3: An XML document with an XSL style sheet applied
Figure 5-4: Opening an XML document and applying an XSL style sheet at the same time
Figure 5-5: Applying an XSL style sheet to produce alternative XML content
Figure 5-6: Trying to open a document that is not well formed
Figure 5-7: Displaying the detailed error message in Word
Figure 5-8: Using Save as type to generate an XML document
Figure 5-9: XML Spy showing an XML document generated by Word
Figure 5-10: Viewing the Word XML icon in Windows Explorer
Figure 5-11: The XML Schema tab in the Templates and Add-Ins dialog box
Figure 5-12: The Schema Library within Word 2003
Figure 5-13: The Schema Settings dialog box
Figure 5-14: The Tempates and Add-Ins dialog box
Figure 5-15: Selecting a schema from the Schema Library dialog box
Figure 5-16: The Solution Settings dialog box
Figure 5-17: The Schema Library displaying an added solution
Figure 5-18: Creating a new XML document
Figure 5-19: Attaching a schema to a Word document
Figure 5-20: An invalid XML document in Word
Figure 5-21: Displaying the XML Structure pane
Figure 5-22: The XML Structure pane
Figure 5-23: Applying the root element to the entire Word document
Figure 5-24: Applying an element to a portion of the Word document
Figure 5-25: The Word document after applying all elements
Figure 5-26: Selecting the Ignore mixed content option
Figure 5-27: Showing the XML tags in a document
Figure 5-28: Setting the show placeholder text option
Figure 5-29: Displaying the default placeholder text for XML content in a Word document
Figure 5-30: Customizing the display of placeholder text
Figure 5-31: Entering custom text for the placeholder
Figure 5-32: The changed placeholder names
Figure 5-33: Viewing attributes from the XML Structure pane
Figure 5-34: The Attributes dialog box
Figure 5-35: Saving a Word document in XML format
Figure 5-36: Setting the Save data only option
Figure 5-37: The default warning when saving XML content
Figure 5-38: The data only XML document created by Word
Figure 5-39: Saving a Word document with a transformation
Figure 5-40: The transformed XML document
Figure 5-41: Protecting the Word document
Figure 5-42: Enforcing protection in the Word document
Figure 5-43: The Start Enforcing Protection dialog box allows you to add a password.
Figure 5-44: The protected document
Figure 5-45: The Flash interface
Figure 5-46: Testing the Flash movie
Figure 5-47: The completed Flash movie
Figure 5-48: A news item within a table
Figure 5-49: The updated Flash interface
Figure 5-50: The completed Flash interface showing two news items

Chapter 6: Working with XML in Excel 2003

Figure 6-1: Excel asks how an XML document should be opened.
Figure 6-2: Excel will create a schema if one cant be found.
Figure 6-3: An XML document opened in Excel
Figure 6-4: Right-click List options within Excel.
Figure 6-5: Displaying totals
Figure 6-6: Refreshing the XML data in the Excel list
Figure 6-7: Excel cannot open a document that isnt well formed.
Figure 6-8: The XML Error dialog box
Figure 6-9: Opening an XML document as a read-only workbook
Figure 6-10: A read-only view of XML data
Figure 6-11: Using the XML Source task pane when opening an XML document
Figure 6-12: The XML map for the address.xml file
Figure 6-13: The list structure created from XML map elements
Figure 6-14: Importing XML data into the Excel list
Figure 6-15: The imported data within Excel
Figure 6-16: Dispaying the XML Source pane
Figure 6-17: Opening an XML document that references a style sheet
Figure 6-18: Opening a nonrepeating element in a list
Figure 6-19: Positioning nonrepeating items outside of the list
Figure 6-20: Opening an XML document with mixed content in Excel
Figure 6-21: Excel has difficulty opening an XML document with a complex structure.
Figure 6-22: The list arising from the amended XML document structure
Figure 6-23: The completed Excel file from exercise 2
Figure 6-24: Using Save As to generate an XML document
Figure 6-25: The Excel XML icon
Figure 6-26: SpreadsheetML generated by Excel
Figure 6-27: Displaying the XML Maps dialog box
Figure 6-28: The completed XML Maps dialog box
Figure 6-29: Dragging elements from the XML map to the worksheet
Figure 6-30: Selecting a heading option
Figure 6-31: Choosing XML Map Properties
Figure 6-32: Enabling the validation option
Figure 6-33: Exporting XML data from Excel
Figure 6-34: XML content exported from Excel
Figure 6-35: Using Save As with the XML Data option
Figure 6-36: Loss of features warning when saving as XML data
Figure 6-37: The catalog.xml file with XML map
Figure 6-38: When a datatype mismatch is detected , Excel asks about cell formatting.
Figure 6-39: The catalog.xml file with XML elements mapped
Figure 6-40: The structured XML file saved from Excel
Figure 6-41: The List toolbar
Figure 6-42: Options in the List drop-down box
Figure 6-43: The catalog.fla interface
Figure 6-44: The Output window showing the contents from the XML document
Figure 6-45: The Flash interface after populating the List component
Figure 6-46: The completed Flash application showing a selected item

Chapter 7: Working with XML in Access 2003

Figure 7-1: The relationships within documents.mdb
Figure 7-2: Exporting a table from Access
Figure 7-3: Choosing which files to export from Access
Figure 7-4: Exported XML content from Access displayed in XMLSpy
Figure 7-5: The datasheet view of tblDocuments
Figure 7-6: The Datasheet view of qryBookDetails
Figure 7-7: The qryBookDetails object exported in XML format
Figure 7-8: The qryBookDetails object exported in XML format
Figure 7-9: The schema document generated by Access
Figure 7-10: Generating a style sheet from Access
Figure 7-11: The style sheet generated from Access shown in XMLSpy
Figure 7-12: The transformed HTML document generated by Access
Figure 7-13: The More Options button in the Export XML dialog box
Figure 7-14: The Export XML extended dialog box allows you to select linked tables.
Figure 7-15: The linked tables exported in XML format
Figure 7-16: Selecting all linked tables from the Data tab
Figure 7-17: The XML content produced from three linked tables
Figure 7-18: The Transforms button in the Export XML dialog box
Figure 7-19: Adding a style sheet to the Export process
Figure 7-20: Comparing the transformed document (left) with the exported content
Figure 7-21: The transformed XML data from exercise 4
Figure 7-22: The XSLT style sheet used in the transformation
Figure 7-23: Options available on the Schema tab
Figure 7-24: The exported XML document with an embedded schema
Figure 7-25: The Presentation tab in the Export XML dialog box
Figure 7-26: Importing external XML data into Access
Figure 7-27: The Import XML dialog box
Figure 7-28: The Finished importing document message from Access
Figure 7-29: The Import XML dialog box
Figure 7-30: Access displays an error message if you try to import a document that is not well formed.
Figure 7-31: Access cannot import records that would cause an error.
Figure 7-32: A detailed error message in the ImportErrors table
Figure 7-33: The Transform button in the Import XML dialog box
Figure 7-34: Adding a transformation
Figure 7-35: Access has completed the import.
Figure 7-36: Tranformation errors prevent XML data from being imported in Access.
Figure 7-37: The documents.fla interface.
Figure 7-38: The Output window showing the XML trees
Figure 7-39: The populated List component
Figure 7-40: Testing that the ComboBox components have successfully loaded

Chapter 8: Using the Data Components with XML

Figure 8-1: Using read-only XML data in Flash
Figure 8-2: Using updatable XML data in Flash
Figure 8-3: The XMLConnector component icon
Figure 8-4: The Component Inspector panel
Figure 8-5: The Schema tab in the Component Inspector panel
Figure 8-6: Importing a schema from a sample XML document
Figure 8-7: A sample results schema
Figure 8-8: The results schema showing attributes
Figure 8-9: Clicking the Add a field button
Figure 8-10: Configuring a new field
Figure 8-11: The settings for an Array field
Figure 8-12: Adding a Behavior to trigger the XMLConnector
Figure 8-13: Selecting the XMLConnector component
Figure 8-14: The Behaviors panel showing the new Behavior
Figure 8-15: The ActionScript generated by Flash
Figure 8-16: The completed Parameters tab
Figure 8-17: Tracing the results property of the XMLConnector
Figure 8-18: The Add binding button in the Bindings tab of the Component Inspector
Figure 8-19: Selecting an element for binding
Figure 8-20: A binding in the Bindings tab
Figure 8-21: A binding in the Bindings tab
Figure 8-22: Without a formatter, the the child elements display in the component.
Figure 8-23: Setting the Rearrange Fields options
Figure 8-24: The List component showing only the name from the XML document
Figure 8-25: The address book interface
Figure 8-26: The additional Index for ˜contact setting
Figure 8-27: The settings for the phone binding
Figure 8-28: The completed phone book application
Figure 8-29: The icon for the DataSet component
Figure 8-30: Binding to the dataProvider of a DataSet component
Figure 8-31: Adding a component property to the schema of a DataSet component
Figure 8-32: The XUpdateResolver icon
Figure 8-33: The update process using a DataSet and XUpdateResolver
Figure 8-34: Binding to the xupdatePacket of a DataSet component
Figure 8-35: The Flash interface for the address book application
Figure 8-36: Configuring the XMLConnector component
Figure 8-37: The schema created from the file address_simple.xml
Figure 8-38: Clicking the Add a component property button in the Schema tab
Figure 8-39: The Schema tab showing the new component properties
Figure 8-40: The Flash interface showing the populated DataGrid component
Figure 8-41: The library contents
Figure 8-42: The completed interface
Figure 8-43: The completed interface

Chapter 9: Consuming Web Services with Flash

Figure 9-1: Internet Explorer showing the Moreover Web Developer news
Figure 9-2: The Flash interface for the Web Developer News movie
Figure 9-3: The Flash interface showing the loaded Web Developer news
Figure 9-4: The Flash RSS feed
Figure 9-5: The Flash RSS interface
Figure 9-6: The schema imported from flashRSSSample.xml
Figure 9-7: The interface with the loaded content
Figure 9-8: The interface showing the bound components
Figure 9-9: The WebServiceConnector component icon
Figure 9-10: The WebServiceConnector parameters
Figure 9-11: The operations available from the Google WSDL document
Figure 9-12: The Schema tab available after selecting an operation
Figure 9-13: Adding a parameter binding
Figure 9-14: Selecting a component for the binding
Figure 9-15: Entering a constant value for the binding
Figure 9-16: Adding a Behavior panel to trigger the WebServiceConnector
Figure 9-17: Selecting the Data Source component to trigger
Figure 9-18: Adding a binding for the results
Figure 9-19: Binding to the dataProvider of a List component
Figure 9-20: Setting the Rearrange Fields formatter options
Figure 9-21: The Web Services panel
Figure 9-22: Refreshing all web services
Figure 9-23: Defining web services
Figure 9-24: The Define Web Services dialog box
Figure 9-25: Viewing the WSDL through the panel menu
Figure 9-26: The currency converter interface
Figure 9-27: The ComboBox components are populated using ActionScript.
Figure 9-28: The completed bindings for exercise 3
Figure 9-29: The Airport weather interface
Figure 9-30: The results displayed in a TextArea component
Figure 9-31: The weather displayed in a TextArea component
Figure 9-32: The completed Aiport weather application
Figure 9-33: The completed tip application
Figure 9-34: The Tip web service bound to a TextArea component
Figure 9-35: Log messages shown in an Output window
Figure 9-36: The Temperature converter interface
Figure 9-37: Log messages from the temperature conversion web service

Chapter 10: Using the XMLSocket Class

Figure 10-1: The Run dialog box
Figure 10-2: The Unity server has been started successfully.
Figure 10-3: An Output window showing the success messages
Figure 10-4: The uClientCore component in the library
Figure 10-5: The chat application interface
Figure 10-6: Checking the connection to the chat room
Figure 10-7: A chat message displaying in the application

Chapter 11: Which XML Option is Best for Me?

Figure 11-1: The decision-making process

Категории