phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Error when instantiating a button with a texture key not in the cache

Open nesheroj opened this issue 11 years ago • 3 comments

Possible regression or unintended breaking change

  • Earliest occurrence: Phaser 2.3.0
  • Prior Behaviour (2.2.2): console warning, but no error whatsoever.
  • Stack trace:
Uncaught TypeError:
Cannot read property 'getFrameByName' of null
  Object.defineProperty.set
  Phaser.Component.LoadTexture.frameName.set
  Phaser.Button.changeStateFrame
  Phaser.Button.setStateFrame
  Phaser.Button.setFrames
  new Phaser.Button
  • Repro: http://plnkr.co/edit/PPEdRHcn6mrN8ZQNvLiN

You can check by swapping phaser versions in the provided plunkr.

nesheroj avatar Apr 08 '15 14:04 nesheroj

It's probably intended behaviour (My use case was not wanting to load textures while unit testing my components), but I found no documented change about it.

nesheroj avatar Apr 08 '15 14:04 nesheroj

I have the same issue. Any news about it?

AbrahamAlcaina avatar Apr 10 '15 07:04 AbrahamAlcaina

Looks like the guard added to the frame setter wasn't applied to frameName. Now done, should solve this issue.

photonstorm avatar Apr 13 '15 10:04 photonstorm