Thursday, May 13, 2010

ReferenceError: Error #1065 in getDefinitionByName()

The Problem:

Getting a ReferenceError: Error #1065: variable {className} not found in the getDefinitionByName()

The Solution:

Define a variable of the class being referenced in your main application

The Explanation:

Flash Player when compiling does not compile all the classes. It leaves out some of them which are not referenced in the application. Even though this is useful in the removal of unnecessary code and the reduction of swf size, this becomes a problem when working with dynamic classes. So when we define an object of the class in the main application the compiler then compiles the class into the source, thus removing the error.

No comments :