Instantiation attempted of a non-constructor

October 28th, 2010 by admin » (0) » AS3

Something that might help you save some precious time of your life.
If you get this error with (perhaps) a class you’ve coded, try this:

Don’t give the variable the same name as the class you want to instantiate…

var MyClass = MyClass();

is bad.

var varName = MyClass();

will probably work.

Max Schalch

About the author

Max, twentysomething, is a designer and developer from Bavaria. He runs his own business and was long time employed in media and advertising.
On he blogs about ActionScript, Flash, ColdFusion and all the other stuff.

Twitter | XING | LinkedIn | Facebook

Leave a Reply