Using dot syntax to access XML data


show more Using dot syntax to access XML data provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training show less
please wait ...

Using dot syntax to access XML data

Once you've loaded XML data into Flash, you can work with that data using dot syntax. That's part of the benefit of XML being native in ActionScript 3.0. Here if I test the movie, you can see the XML data in the Output window. Let's take a look. So we have the images root element and then inside of there are image child elements, and each one of those elements has an attribute called file that has the file name of an image.

Now, let's say we want to access the file name of each image. Let's go back to our code and see how to do that. We'll just leave this code in a trace statement for now. We'll look at applying it to an actual image later on. So after imagesXML, you can type a dot and then type image. Now if you test the movie right now, here is what you'll get. Let's look in the Output window.

This actually gives us a list of all the child elements named image. So if we go back to our code, imagesXML represents that outer XML element. It has a child c...

Using dot syntax to access XML data
Video duration: 4m 2s 7h 8m Beginner Updated May 23, 2012

Viewers:

Using dot syntax to access XML data provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training

please wait ...