Highlighted

Control Movieclip timeline with Touchscreen

New Here ,
Dec 18, 2019

Copy link to clipboard

Copied

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

Views

65

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Control Movieclip timeline with Touchscreen

New Here ,
Dec 18, 2019

Copy link to clipboard

Copied

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

Views

66

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 18, 2019 0

Have something to add?

Join the conversation