i don't have a direct answer to your question but you can work-around the problem by using:
var image:*=new classRef();
I would, but all my media is in an swc file... and anything that needs to be referenced by getDefinitionByName but first be instantiated... otherwise, that is indeed what I would sololy do.
i don't understand your last messge but i infer my suggestion doesn't help you for some reason.
My actual project has something like 9200 images in it.
if my main project, let's call it "main.fla", was to contain every one of those images, every time I tried to run or debug it, it would take FOREVER to compile... as a work around that I discovered in a previous project was to put all my graphics and media into an swc file. (Let's call it MyLibrary.swc)
While I was trying to get the swc working, I discovered that while my media in the swc was indeed setup to be exported for actionscript with unquie classes and everything, when I compiled and built my project, I could not get any of those media elements using the getDefinitionByName function.
After alot of reading and trail and error I found that the only way to get it to work was to have someplace in my code, an actual reference to the objects that I was trying to get with getDefinitionByName. It turned out, that without instantiating the object in the code, the compiler was omitting it.
Now, but instantiate, I mean doing this:
var bm:BitmapData = new MyImage();
Where MyImage.png is in my swc and has a class defined as "MyImage"
Once I do that, then I can do this
var classRef:Class = Class( getDefinitionByName("MyImage") );
But without that line above SOMEWHERE in my code (even if it's not actually executed), the getDefinitionByName returns an error saying it can't find the class.
Now, here's the problem.
When I import all my images into my swc library they get named with the file extention... "MyImage.png" and when I select all the images that Imported and batch set the export for actionscript, they get automatically assigned a class name equal to their library name, so the class name is "MyImage.png"
so if I wanted to use getDefinitionByName to access the class, I would need to instantiate it in my code by doing this:
var bm:BitmapData = new MyImage.png();
BUT, that is erronous as the period causes an error and the adobe docs says right in it that class names can't use periods or any other non-alphanumeric character.
So while the getDefinitionByName function DOES actually work with classes with periods in them, because my media is external of the main.fla, I can't load it unless it's instantiated first, which leaves me right back where I was.... having to to manually rename over 9000 classes manually one at a time.
I did some searching and found the "Flash Library Renamer" extension, but it requires me changing all my class names to be sequenial, which the vast majority is not.
Is there a way that I can import the files into the library and have it omit the file extension?
if not, is there a way that I can set the class names in a batch and not have it use the file extentions?
if not, is there an Flash Extention or plug in that will allow batch renaming using regular expression or wildcards?