How to Load XML into Flash from an External File

Sun, Mar 7, 2010

ActionScript

Part 2 of a picture gallery tutorial.

In order to keep script organized or to re use code, it is common practice to keep XML code on a separate file. Here is how we load it into Flash.

Due to security restrictions XML files are not allowed to be uploaded into my web host, Godaddy. Even so it is possible to download the same file with an TXT extension.

XMLData

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 Loading XML into Flash
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest (“data/XMLData.xml”));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded (event:Event) {

trace (event.target.data);

}

Related Articles:

, , , , , ,

2 Responses to “How to Load XML into Flash from an External File”


Trackbacks/Pingbacks

  1. Do you Have Facebook?…

    Lets Be facebook friends I really like this post….

  2. great info…

    discover here…

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


832
Unique Visitors
Previous 30 Days
Powered By Google Analytics