04.05.12

Flash CS5.5 Error ArgumentError: Error #2012: DisplayObject$ class cannot be instantiated.

Posted in Flash at 3:36 am by Curtis J. Morley

ActionScript Error 2012 Description:

AS3 Error 2012 is a great Flash error. It is descriptive and tells you exactly what it means. Argument Error 2012 means that when instantiating a DisplayObject you do not create a new DisplayObject since there is only one DisplayObject Class an it is already instantiated with every swf you create.

Flex / Flash Error #2012 Fix:
Remove "new DisplayObject();" from your ActionScript.

Bad Code:

var newClip:DisplayObject = new DisplayObject();

Good Code 1:

var newClip:DisplayObject;

This should help you resolve Flex / Flash Error #2012

Thanks and as always Happy Flashing

Curtis J. Morley

 

Leave a Comment