AS3 for class

How to convert a string to a class without getDefinitionByName, because this class is not associated with a library element, and getDefinitionByName only works with classes that are associated with the library or are already initialized! Is there any way? Or do I need to initialize every class that I want to use ?! That would be so stupid with Adobe!

+3
source share
2 answers

getDefinitionByName()will work with any class name associated with the library or not. Probably your problem is that since you are not mentioning the class name in the code, it is not in your swf at all. You will need to make sure that the class is used in at least one place in your code if it is not compiled.

, :

public class Main {

    public function Main(){
        ClassYouWant;
        AnotherClass;

        codeThatDoesStuff();
    }

}
+3

:

( @grapefrukt), , RSL (Runtime Shared Library)

:

, getDefinitionByName().

. , , , , . , : swf , , .

, :

  • (RSL)

( ) , . swf.

swf, . , swf . : swf, getDefinitionByName() .

enter image description here

+1

All Articles