ReferenceError: Error #1065: Variable var_name is not defined.
I had this problem and tried almost everything to fix it, finally found the root of the problem after having outcommented some of the code.
I had created a variable with the same name as an object/class in the Library, it seems this is prohibited.
My code was:
var sound1_snd = new sound1_snd; // WRONG!!

It should be:
var sound1 = new sound1_snd; // CORRECT