Comparison between a value with static type Array and a possibly unrelated type Class

Posted by Kaoru on Game Development See other posts from Game Development or by Kaoru
Published on 2013-10-27T08:07:10Z Indexed on 2013/10/27 10:18 UTC
Read the original article Hit count: 268

Filed under:

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";
   }
}

© Game Development or respective owner

Related posts about actionscript-3