I talked with my friend about this, he is convinced that you can do it and says that he did it, but I can’t get it to work.
I wonder if this is even possible. I tried typing var as a class that is inside the SWF loaded from outside, and then make an instance, but cannot do it.
some code
private static function onCompleteHandler(e:Event) {
dashboardObject = e.target.content;
// registerClassAlias("Dashboard", ); doesnt work
var dash:Class = getDefinitionByName("Dashboard") as Class;
var myDash = new dash();
trace(myDash.show);
}
Error
ReferenceError: Error #1065: Variable Dashboard is not defined.
at global/flash.utils::getDefinitionByName()
at System$/onCompleteHandler()
So, it seems that you cannot create an instance of the class if it is not executed as part of the SWF project. Which, if true, is what I want to do. I don’t want people trying to make instances of my classes only from loading a SWF file for what I am creating here.
thanks
source share