ReferenceError: Error #1065: Variable is not defined.

ReferenceError: Error #1065: Variable is not defined.

Post by Mr. Ander » Thu, 13 Sep 2007 04:54:49


Hi people.

Whatever I do (seems like) I end up with the following message in Flash CS3:

"ReferenceError: Error #1065: Variable is not defined."

I have no clue to what causes it, and therefor I cannot seem to fix it. I've
been trying to look for answers online, but all I got out of that was to
declare my classes as public, which I already had done.

Even a very simple class that runs a trace command from its' constructor
method won't work. It even gives me this message even though I don't have any
variables or trace commands or anything.

This is really annoying, so please help me out :)

A
 
 
 

ReferenceError: Error #1065: Variable is not defined.

Post by kgla » Thu, 13 Sep 2007 05:09:06

show the code for your simple class (and the code that instantiates your class) that causes the error.

 
 
 

ReferenceError: Error #1065: Variable is not defined.

Post by DMennenoh » Thu, 13 Sep 2007 05:15:16

Some code sample would help - and remember classes must be contained within
packages in CS3.

--
Dave -
Head Developer
http://www.yqcomputer.com/
Adobe Community Expert
http://www.yqcomputer.com/
 
 
 

ReferenceError: Error #1065: Variable is not defined.

Post by Mr. Ander » Thu, 13 Sep 2007 16:01:45

Hi there, and thanks for taking time to help me out.

I have a folder, test, that holds the files "myTest.fla" and "myTest.as" . The
attached code is for myTest.as


In my myTest.fla:
in the document class box i have: myTest. (please note the full stop after the
class name).
Also, I have not done anything to the settings in terms of class path etc...

myTest.as code:



package {
import flash.display.Sprite;

public class myTest extends Sprite {
private var hello:String;

public function myTest() {
hello = "thanks for helping me";
trace(hello);
}
}
}
 
 
 

ReferenceError: Error #1065: Variable is not defined.

Post by Mr. Ander » Thu, 13 Sep 2007 16:11:22

I removed the full stop after the document class declaration in the FLA and it
worked now!! What a stupid mistake :)
I'm following the Essential Actionscript 3.0 book, and it looks like they want
you to do that...which obviously is not the case. Thanks for taking time to
help me out!
 
 
 

ReferenceError: Error #1065: Variable is not defined.

Post by kgla » Fri, 14 Sep 2007 15:15:05

you're welcome.