I’m getting Uncaught TypeError: surfaceImage.anims.add is not a function on the line targetImg.animations.add('animA', [ 0, 1 ]);. Am I missing something? Is it the scene’s animations set that I’m supposed to add to? Like this.animations.add(...)?
If all you want to do is change the frame, there’s no need for animations. Simply do targetImg.setFrame(1);.
If you would have an atlas, you would instead of frame index supply the asset name.
Alternatively if you want to change the whole texture to something else, it’s img.setTexture(key, frame).