package
{
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.xml.*;
public class MyClass extends MovieClip
{
public function MyClass()
{
init();
}
public function init():void
{
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("Image.xml")); // Load a XML
myLoader.addEventListener(Event.COMPLETE, processXML);
}
Public function processXML(e:Event):void
{
myXML = new XML(e.target.data);
var ldr:Loader = new Loader();
ldr.load(new URLRequest(myXML.IMAGE[0]));
mc.addChild(ldr);
}
}
}
{
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.xml.*;
public class MyClass extends MovieClip
{
public function MyClass()
{
init();
}
public function init():void
{
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("Image.xml")); // Load a XML
myLoader.addEventListener(Event.COMPLETE, processXML);
}
Public function processXML(e:Event):void
{
myXML = new XML(e.target.data);
var ldr:Loader = new Loader();
ldr.load(new URLRequest(myXML.IMAGE[0]));
mc.addChild(ldr);
}
}
}
No comments:
Post a Comment