You can load XML file in your program written on flash.
Actually it can be any file that is in the same subdomain as the URL where the movie currently resides.
To make it create new FLA with text window and any Movie Clip on scene that we are going to use as something
on what we can write on enterFrame event handler (let's call this Movie Clip timer).
OK, our scene must look like:
Now we will write script only, no design at all!
On the timer object we have to create two events:
var UrlXML='P2.xml'; //URL to XML file
var XmlR=new XML(); //XML object
//XmlR.ignoreWhite=true; //Uncomment this line if you wand ignore spaces in XML
var ILoadXML=1; //Auxiliary variable
/*f***********/
function fnOnEnterFrame()
{
//We enter here on every frame
if(ILoadXML!=null)
{
readXML();
if(ILoadXML==0)
{
txtRes.text=XmlR.toString();
ILoadXML=null;
}
}
}
/*f***********/
function readXML()
{
if(ILoadXML==0.25)
ILoadXML=0;
if(ILoadXML==0.5)
{
if(XmlR.loaded)
ILoadXML=0.25;
}
if(ILoadXML==1)
{
XmlR.load(UrlXML);
ILoadXML=0.5;
}
}
Create file P2.xml in the same folder where your FLA is, containing the following information: