Unable to use if (this.pot1Sprite.isVisible()==true) in update function

Hi,if I use if (this.pot1Sprite.isVisible()==false) in update function, then when I run the project it works properly.

But If I just change false to true then it stops working.
means if I use if (this.pot1Sprite.isVisible()==true) my project fails to run.

This is what I want to do in update function -

if (this.pot1Sprite.isVisible() == true && rectIntersectsRect(this.pot1Sprite.getBoundingBox(), this.hammerSprite.getBoundingBox()) && !isCollide)
{
isCollide = true;
this.potAnimation();
}

please help me what is wrong with it.

Thanks.

hey,
replace rectIntersectsRect with cc.rectIntersectsRect

ok. Thanks problem solved.