public static function getType(type:String):Class
Returns the class Object for the String name representation specified
in the type parameter.
Keep in mind that you will always need an internal reference to
the class that is passed to getType();
For instance, the following code below will throw an error if
there is not an instance of a DataGrid defined previously:
var ClassReference:Class = Reflection.getType("mx.controls.DataGrid");
var dataGrid:DataGrid = new ClassReference();
//throws an exception since Flash Player does not contain a reference
//to mx.controls.DataGrid
The following will not throw an error as Flash Player has reference to
mx.controls.DataGrid
import mx.controls.DataGrid;
var dg:DataGrid;
var ClassReference:Class = Reflection.getType("mx.controls.DataGrid");
var dataGrid:DataGrid = new ClassReference();
//executes without error
Parameters
| type:String — String representation of the class type
|
Returns
Throws