Flash "/>

ReferenceError: Error #1056: Cannot create property

02 September 2008 at 8:41 pm

Quite often, I do projects where I do the code and somebody else do the graphics. I usually set this up so that the designer can work in Flash CS3, whereas I do my code in Flex Builder. I set my class to be the Document Class and then set the FLA to not “Automatically declare stage instances” so I can reference the animators MovieClips inside my code.

Today I got an error that I’ve also gotten on a couple other occasions and I thought I’d blog the solution here for future reference.

This is the error:

ReferenceError: Error #1056: Cannot create property anim1 on Bynett.
	at flash.display::Sprite/constructChildren()
	at flash.display::Sprite()
	at Bynett()

By default, I usually set all properties in a class to “private”. This error will occur if you set a MovieClip to “private” when it should have been “public”. What happens is that since the MovieClip is set to private, the Flash CS3 environment won’t have the required access to this clip. Just make sure that all objects that the designer will control is set to “public” and all is fine.

(Thanks to Kadazuro for reminding me of the solution!)