Phantom class definitions in Flash CS5?
- by cc
I'm trying to get FlashPunk working in the Flash CS5 IDE (don't ask), and I'm having trouble getting it to compile.
In strict mode, the error I'm getting is:
net/flashpunk/FP.as, Line 95
1119: Access of possibly undefined property _inherit
through a reference with static type World.
Typically, this means that there is a missing variable definition or the class being compiled cannot see that variable. Presumably, the framework compiles for others, so I'm pretty sure this isn't the issue, but I went in anyway and made sure the variables existed and set these variables to public (they were set to internal), but the error still occurred. It was almost like the compiler wasn't seeing the property definitions.
If I turn off "strict mode", the app compiles, but then I get this error:
ArgumentError: Error #1063:
Argument count mismatch on World().
Expected 2, got 0.
Now, World is a class in the FlashPunk package. In the class definition for it, the constructor does not expect any arguments:
public function World() { ...
...and yet, for some reason, Flash is expecting two arguments. So it appears that everything is correct, but Flash is somehow expecting something different than what World's constructor defines.
These two issues combined makes it seem like Flash is getting some other phantom version of another class called "World" which has two constructor arguments and different properties.
I've gone in and checked the ActionScript settings. The only external-to-project stuff referenced is the default "$(AppConfig)/ActionScript 3.0/libs". And I'm not using any of my own code other than a single "Main.as" file that super's Engine to set a few parameters - certainly, there's no new World class.
With a generic name like "World", I thought perhaps this is a reserved class name within Flash or something, maybe imported from the default libs mentioned above, but some Googling turning up empty seems to put the lie to that.
Any idea what might be going on?