Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Flash includes classes for working with data formatted in the XML markup language. XML is an abbreviation for Extensible Markup Language and is a standard way of representing structured information so that it's easy for both computers and people to read, access and manipulate. The main project that we'll be working on in this section is an XML slideshow. I'm going to provide for you an XML file that lists a series of images with some descriptions. Flash will then use those image and description in a script, an ActionScript, that will pull in that data to create a slideshow that looks like this. If you open up the slideshow.fla file, this is actually going to be in a subfolder of the work files folder called XML Slideshow. You'll notice that there's an XML file as well as the slideshow FLA file, but if you do a Control, Test Movie on that you can get a preview of what we'll be working on in here; just a series of slides that fade in and fade out with the description on the bottom. Also, the slide counter in the lower right-hand corner. So, that's the file that we'll be working toward. I'll be explaining the various ways that Flash integrates with XML and be going through the various classes. Now, XML uses tags very similar to HTML, but instead of describing the structure of the page, XML tags describe the data on the page. This makes it easier to export and import data from different systems. Due to its simplified markup language, XML makes it easy for different systems to read data in without knowing the exact structure of the data. If the XML data description has been properly created it's possible to add additional information to your XML data files without affecting systems that are already using the information. For example, if you load XML data into Flash an object model will be created that allows you to easily manipulate and extract that data. The same object model is available to create XML data and export it to another external system, for example, in my SQL database or JavaScript function. Here's an example of a very simple XML data file. In looking at this example of XML you'll notice that it looks a lot like HTML. In a way, HTML rather is a type of XML, though HTML was introduced before XML. Their structure is, in many cases however, exactly the same. Now there's no special bond or relationship between Flash and XML. Flash does, however, provide you with a simple means of collecting data from an XML source and then interpreting it in a way that can be understood in ActionScript. More simply stated, XML gives you a way of loading information into Flash. In most uses you'll be getting some formatted text that you can then load into Flash during runtime. Now at this point you may be wondering why you just can't simply load information directly into Flash from a simple text file. For retrieving information external to the Flash file the load variables method might work when loading simple or small amounts of information, but once you have to retrieve information that changes or information that is being created by an external source you'll want to use XML. In the example that we'll be looking at later in creating an XML Slideshow notice that the information here is organized very carefully. I have the path to the actual image file as well as this description. So notice that the information is more structured than if I had just a normal text file. To change anything in this Slideshow I would simply change the name of the images and then the label over here. Very, very easily done here in a text editor like Notepad. Now if you're new to XML let me provide a brief description of the most common aspects of XML data in the next movie. If you're already familiar with XML you can go ahead and skip over the next movie and start learning about the Flash ActionScript classes directly for working with XML.
| Course: | Adobe Flash ActionScript 3.0 for Designers |
| Author: | James Gonzalez |
| SKU: | 34060 |
| ISBN: | 1-935320-82-3 |
| Release Date: | 2009-11-09 |
| Duration: | 9.5 hrs / 101 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |