Loading an XML file


show more Loading an XML file 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 ...

Loading an XML file

Loading files into Flash allows for smaller SWF file sizes and easier adjustments to your applications. XML is no exception. Let's take a look at how to load an external XML file into Flash. Select the first keyframe of the actions layer and open up the Actions panel. If you've loaded in a text file, then an XML file is exactly the same process. So we'll create a variable called imagesXML, in all caps. Datatype it to XML. We'll give this variable a value later on, once the data is loaded. And I am creating a variable here so that we can access it anywhere in our code.

Go to the next line and create a variable called xmlLoader, with a capital L. Datatype it to URLLoader. Set it equal to a new instance of the URLLoader class, exactly like what you would do with loading a text file. Go to the next line. Add an EventListener to the XML loader; xmlLoader.addEventListener. Event is going to be Event.COMPLETE, which means the file is finished loading. Type comma and a space. I'...

Loading an XML file
Video duration: 3m 26s 7h 8m Beginner Updated May 23, 2012

Viewers:

Loading an XML file 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 ...