Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Control Movieclip timeline with Touchscreen

New Here ,
Dec 18, 2019 Dec 18, 2019

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

 

 

 

TOPICS
ActionScript , Code , Tablet , Timeline
135
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation