Main uses :
1, in the use of flash projects, put some components, by setting the link class, and then use this class, through the GetClass method can take down the material
Figure 1 (see Example 1)
2, many of the classes are divided into different SWF, and then by invoking the SWF, to invoke the function of the class library, and then through the getclass to get the class (see Example 2)
Index.base.net.ClassLoader class Explanation:
Load the SWF file and get the class by calling GetClass, or you can get the definition of the namespace or function
Constructors
Public Function ClassLoader (obj:object = Null,lc:loadercontext = null)
Parameter 1 can be a string, can be a bytearray, if the former is a load method, the latter using the Loadbytes method
Parameter 2 is to create a ClassLoader instance with the specified Loadercontext object, Loadercontext can set whether to load Cross-domain files, application domains, etc., as described in the official Loadercontext Class!
Load method
Public function load (_url:string,lc:loadercontext = null): void
Loading files
Parameter 1 is the load address, and parameter 2 sees the constructor
Loadbytes method
Public Function loadbytes (bytes:bytearray,lc:loadercontext = null): void
Load byte file
Parameter 1 is byte data, and parameter 2 sees the constructor
GetClass method
Public Function GetClass (classname:string): Object
Gets a public definition, either a class or a namespace or a function definition
Parameter 1 is to get the complete package plus class name for class, such as our class full definition name is Index.base.net.ClassLoader
See examples for details
Hasclass method
Public Function Hasclass (classname:string): Boolean
Returns whether the public definition is included
Parameter 1 See GetClass method
Clear method
Public Function Clear (): void
Empty
URL Property
public Var url:string
Get URL Property
Loader property
public Var Loader:loader
Get Loader Property
Current 1/2 page
12 Next read the full text