Copy link to clipboard
Copied
Basically I want to have the library function of a swc, but the remote loading feature of a swf.
I have a code library which I'm embeding into a swf. All classes and methods no graphical or text elements. After the code is embedded into a swf, I'd like to remotely access this swf from another swf. So swf A contains the classes and it is loaded into swf B is just a shell and uses the methods/classes from swf A as if they were at the root of B.
Copy link to clipboard
Copied
here's one way to load a swf that contains a class that shows how to instantiate that class:
var l:Loader = new Loader();
var s:String = "C";
load1("test.swf");
function load1(urlS:String) {
l.contentLoaderInfo.addEventListener(Event.COMPLETE, f);
l.load(new URLRequest(urlS), new LoaderContext(false, ApplicationDomain.currentDomain));
}
function f(event:Event):void{
var c:Class = Class(getDefinitionByName(s));
var instance:* = new C();
}