About XML

Extensible Markup Language (XML) is becoming the standard for exchanging structured data in Internet applications. You can integrate data in Flash with servers that use XML technology to build sophisticated applications, such as chat or brokerage systems.

In XML, as with HTML, you use tags to specify, or mark up, a body of text. In HTML, you use predefined tags to indicate how text should appear in a web browser (for example, the <b> tag indicates that text should be bold). In XML, you define tags that identify the type of a piece of data (for example, <password>VerySecret</password>). XML separates the structure of the information from the way it appears, so the same XML document can be used and reused in different environments.

Every XML tag is called a node, or an element. Each node has a type (1, which indicates an XML element, or 3, which indicates a text node), and elements might also have attributes. A node nested in a node is called a child node. This hierarchical tree structure of nodes is called the XML DOM--much like the JavaScript DOM, which is the structure of elements in a web browser.

In the following example, <portfolio> is the parent node; it has no attributes and contains the child node <holding>, which has the attributes symbol, qty, price, and value:

<portfolio>
    <holding symbol="rich"
        qty="75"
        price="245.50"
        value="18412.50" />
</portfolio>

For more information, see the following topics:

For more information on XML, see www.w3.org/XML.

For a source sample that demonstrates how to create a web log tracker by loading, parsing, and manipulating XML data, xml_blogTracker.fla, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download the Samples zip file and navigate to the ActionScript2.0/XML_BlogTracker folder to access this sample.

For a source sample that demonstrates how to use XML and nested arrays to select strings of different languages to populate text fields, xml_languagePicker.fla, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download the Samples zip file and navigate to the ActionScript2.0/XML_LanguagePicker folder to access this sample.

For a source sample that demonstrates how to create a dynamic menu with XML data, xmlmenu.fla, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download the Samples zip file and navigate to the ActionScript2.0/XML_Menu folder to access this sample. The sample calls the ActionScript XmlMenu() constructor and passes it two parameters: the path to the XML menu file and a reference to the current timeline. The rest of the functionality resides in a custom class file, XmlMenu.as.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001055.html