CHAPTER 10 USING FLASH TO DISPLAY XML (Free web design)

CHAPTER 10 USING FLASH TO DISPLAY XML 305 Tip If you re not familiar with Flash, you can generate a web page that displays the SWF file by choosing File . Publish. Flash will create the web page in the same folder as the SWF file. In this example, you saw how to load an XML document into Flash and display it in UI components. You can also use Flash to update content and send it to a server-side file for processing. Updating XML Content in Flash As you saw earlier in this chapter, Flash can use methods such as createNode(), appendNode(), insertBefore(), and cloneNode() to manipulate an XML tree. The manipulation takes place within Flash, but if you need to update an external data source, you ll have to send the content to a server-side file for processing. I ll work through an example where I take user input and use it to update the dvd.xml document tree within Flash. You can find this example saved in the file dvd3.fla. Figure 10-5 shows the interface populated with the dvd.xml file. Figure 10-5. The interface of the dvd3.fla movie This interface allows you to view the details of a DVD, add a new DVD to the XML tree, and edit or remove an existing DVD. If you open Frame 1 of the actions layer with the F9 shortcut key, you ll see that it s a little more complicated than the previous example. To start with, there are now three timeline variables: var rootNode:XMLNode; var selectedDVDNode:XMLNode; var booNew:Boolean = true; The added third line creates a Boolean variable that determines whether to add a new node or to edit an existing node.
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply