Pressmove event not working with if else statement
I made a switch button (first click: shape1_animation plays, second click: shape2_animation plays) in Adobe Animate. It works fine with the "click" event. But it doesn't work with the "pressmove" event and I wonder why.
Projectfile:
https://www.dropbox.com/s/2mh8fxah9o7a7qk/play_movieclip%2005.fla?dl=0
When I "pressmove" the button, the two animations play simultaneously. So it completely ignores the if else statements
Maybe there is a simple awnser to this?
this.button.addEventListener("pressmove", onPressMove.bind(this));
let counter = 0;
function onPressMove() {
if (counter == 0) {
this.shape1_animation.play();
counter=1;
} else {
this.shape2_animation.play();
counter=0;
}
}
