ReferenceError: Error #1065: Variable SimpleMP3Player is not defined.
I had set the linkage, in the linkage properties, of a symbol to point to the class SimpleMP3Player.
The class was written as follows:
packageI checked the adobe live docs and read:
{
import flash.display.*;
class SimpleMP3Player extends MovieClip
{
function SimpleMP3Player()
{
trace("MP3 Player instantiated");
}
}
}
1065 Variable _ is not defined. You are using an undefined lexical reference. For example, in the following statements, the statement trace(x) generates an error because x is undefined. However, the statement trace(y) doesn't generate an error because y is defined:
trace("hello world")
trace(x) // x is undefined
var y
trace(y) // No error, y is defined.
It didn't take too long to see that I had simply forgotten to declare the class SimpleMP3Player as public. Nevertheless, there could have been a much better error for this. When you take your compiler classes, they always teach you to include common errors in your parser so you can provide useful error messages. Apparently the Adobe AS3 developers weren't paying attention.
22 comments:
This happened to me today. I was going nuts trying to figure out where I went wrong until I came across your post. Thanks!
Thank you. Your explanation was spot-on, unlike Adobe's.
Good call on the public class thing. I was battling this error for the longest time!
Thanks for this post. I know I have to declare my classes as public, but today, I just forgot. Good thing I came across your post.
I've got the same error popping up on two machines. The strange part is that two weeks ago when I put the project on hold everything was working perfectly. Secondly, I am receiving this error for mx.containers::Grid. This is especially weird because I'm creating the Grid component in MXML. Any thoughts as to why?
Hi there, and thanks for your post. Not much information in regards to this out there...
I however get this errer regardsless of what I'm trying to do. Really annoying. Even though I don't have any variables in my class (just to check), I get this cryptic message. Any suggestions?
Just joining in on the thanks list - I'm rebuilding my AS2 site in AS3 and fell down on the Document Class immediately because I forgot the magic word "public". Thanks for the simple solution, and best of luck.
Thank you very much for posting this. You just helped me solve the exact same problem! public class... *grumble* :)
thanks man, it helped me a lot!
thanks man, it was helpful
I read this solution but still didn't get it at first for some reason. I had made the constructor public and thought that was it. But of course you actually have to make the class public.
If you're still having problems, maybe you are actually getting the error because of the example in the Adobe description, which is using a variable without declaring it.
Your post helped me to solve the same problem after i went crazy from this error message :)
Thank you!
OMG LOL ROFL,
Yes ...public class... too, perhaps code 1065 can be used as a social foepah fer "no public class" haahaahaaaa,.. its late sorry,
thanks for the Tip mang..
-Karnei
Thank you so much. I wasted 2 hours trying to figure this out.
LIVESAVER! First result in Google!
Please note: this is good Internet!!!
thx again dude.
Woah, what a dumb error message. Lost a couple of minutes troubleshooting this myself. Thanks to Google and you, I can carry on doing real work. Good call to put this in a blog post
thanks, I feel stupid for forgetting to declare the class public, but it would have taken my a long time to figure out what the problem was if it were not for your post.
Thanks for this you just saved me half an hour of pointless debugging.
Thanks for putting it up, I also forgot to make the class PUBLIC xD
thanks, this helped alot
Yeah, just got bitten by this one. Got about 20-30 classes in my project. All the main ones seemed to be listed as "public", but a small minor one was missing the "public" statement and it caused an error for every single clip in my library and NOTHING would work.
It was a very frustrating 5 hours picking through various versions of my code! So check ALL your classes to make sure they're public! Hope this helps someone!
Simon.
thanks, worked for me :)
Post a Comment