Comparison between a value with static type Array and a possibly unrelated type Class
- by Kaoru
I got this error:
Comparison between a value with static type Array and a possibly
unrelated type Class.
After i modify the class to many classes (before that, everything is on 1 class (all of the functions)), but after i move everything to many classes (all the functions is not on 1 class), that error appear.
How to solve this?
I am using AS3 and as3isolib Library.
Here is the code after i modify the function:
if (Constant.dude.y < Constant._numY)
{
if (Constant.dude.sprites != marioBackClass)
{
Constant.dude.sprites = [marioBackClass];
Constant.dudeDir = "Up";
}
}
Here is the code before i change the function to many classes:
if (dude.y < ._numY)
{
if (dude.sprites.toString() != marioBackClass.toString())
{
dude.sprites = [marioBackClass];
dudeDir = "Up";
}
}