Skip to main content
lucag31148961
Participant
December 18, 2019
Question

Control Movieclip timeline with Touchscreen

  • December 18, 2019
  • 0 replies
  • 151 views

Hi all,

 

i have a problem with TouchEvents.

i make an image sequenze with 105 pictures. if i´m slide right or left on the Touchscreen, i want to rotate a 360 degrees Product.

i´m using the following script and in the previewe from Adobe Animate CC work it with the touchscreen. But if im export it in a swf file, dont cant navigate with the Touchscreen.

 

var startPosition:Number = mouseX;
var delayTime = 0.5; // 0.25 sec


gun.gotoAndStop(1);


stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);


function onMouse(e:MouseEvent): void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouse);
var currentPosition:Number = mouseX;
if (currentPosition-startPosition >= 0) {
gun.gotoAndStop(gun.currentFrame + 1);
} else {
gun.gotoAndStop(gun.currentFrame - 1)
}
if(gun.currentFrame == 105) {
gun.gotoAndStop(2);
}
if(gun.currentFrame == 1) {
gun.gotoAndStop(104);
}

setTimeout(setListener, delayTime);
}

function setListener(){
startPosition = mouseX;
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
}

 

Thanks and Regards

Edward

 

 

 

This topic has been closed for replies.