maguskrool
Technical User
And hello again...
I created a custom class called MyFile.as (see attached code), representing a css or xml file to be loaded. The purpose of this class is to gather several properties relating to a file, so they can be used by several .swfs that will be loaded later.
I create an instance of MyFile, load some content with an URLLoader (uld) and listen for the load to complete. How can I then reference the MyFile instance to which the URLLoader belongs?
Thank you.
I created a custom class called MyFile.as (see attached code), representing a css or xml file to be loaded. The purpose of this class is to gather several properties relating to a file, so they can be used by several .swfs that will be loaded later.
I create an instance of MyFile, load some content with an URLLoader (uld) and listen for the load to complete. How can I then reference the MyFile instance to which the URLLoader belongs?
Thank you.
Code:
//MyFile.as
//I'm not including the package and import stuff.
public class MyFile {
private var _urlLoader:URLLoader;
private var _special:String;
//getter and setter for _urlLoader: uld; _special: spl;
public function MyFile($special:String):void {
_special = $special;
}
}
//.fla
var myOne:MyFile = new MyFile("blah one");
myOne.uld = new URLLoader(new URLRequest("one.xml");
myOne.uld.addEventListener(Event.COMPLETE, handleAll);
//same for myTwo,...,myN.
function handleAll(evt:Event):void {
//Should on act on the myN.spl property.
}