I have a bunch of graphics assets in a fla, the MovieClips are linked to some classes. I export the fla as a swc , which I add to my library with the option "Merged into Code".
All works great, I can create instances of my MovieClips , just by calling their classes like this.
//example 1
var newMc:BaseClass = new GraphicAsset();
Now if I want do the following , Flash throws an error , GraphicsAssetClass is null!
//example 2
var GraphicsAssetClass:Class = getDefinitionByName("GraphicAsset") as Class;
The only way I can get the above line to work is to do this
//example 3
var newMc:GraphicAsset;
var GraphicsAssetClass:Class = getDefinitionByName("GraphicAsset") as Class;
//then I'm able to do this
var newMc:BaseClass = new GraphicsAssetClass();
Can you think of a solution where I could simply get the class by calling getDefinitionByName() like I do on example 2 , without having to resort to example 3 solution.
GraphicAsset
? Is it justGraphicAsset
or is there a package too? – Simmer