Using getDefinitionByName, can you find a class that's inside a loaded swf?
Like in this example, Test is a class inside "test.swf".
public function GetDefinitionByNameExample() {
var request:URLRequest = new URLRequest("test.swf");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeEvent);
loader.load(request);
}
private function completeEvent(e:Event):void{
var ClassReference:Class = getDefinitionByName("Test") as Class;
var instance:Object = new ClassReference();
}
I get an Error #1065: Variable Test is not defined.
But it works fine if I call getDefinitionByName from within test.swf So is it
something I'm doing wrong or does this method only works within a single swf?
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com