Skip to main content
ewaa67603811
Participant
December 18, 2019
Answered

problem with the touch screen

  • December 18, 2019
  • 1 reply
  • 1249 views
Hi, I have a problem with the touch screen. I made a simple animate application containing 5 buttons switching to a given frame. When I use the mouse, everything is ok - but I know from the client that the buttons on the touch screen do not work. Unfortunately, the client is 180 km away from me - and I don't have access to the touch screen connected to windows.
The code on the buttons looks like this:
"button_6.addEventListener (TouchEvent.TOUCH_TAP, fl_TapHandler_6);

function fl_TapHandler_6 (event: TouchEvent): void {
gotoAndPlay (6);

}


button_6.addEventListener (MouseEvent.CLICK, f5_ClickToGoToAndPlayFromFrame);

function f5_ClickToGoToAndPlayFromFrame (event: MouseEvent): void {
gotoAndPlay (6);
}
"
I am begging you for help, in 2 days I must have everything working.
greetings
Eve
 

 

This topic has been closed for replies.
Correct answer ClayUUID

His code is for an HTML5 Canvas document, which of course won't work in an AS3 document. No idea why he posted it.

 

On properly functioning touchscreen devices, you shouldn't even need to mess with the TouchEvent class for something as simple as clicking buttons, since the touchscreen driver should be presenting touch events to the operating system as simulated mouse events.

1 reply

sumanr49634048
Known Participant
December 19, 2019

Hi
add this code... 

if(createjs.Touch.isSupported()){
createjs.Touch.enable(stage, true, true);
}

example:

if(createjs.Touch.isSupported()){
createjs.Touch.enable(stage, true, true);
}

myMc = this;
function gotoNextFrm(){
myMc.gotoAndPlay("frameNumber");
}
myBtn.addEventListener("click",gotoNextFrm);

ewaa67603811
Participant
December 20, 2019

Hello!
Thanks for the reply, but unfortunately I find out the code: "if (createjs.Touch.isSupported ()) {
createjs.Touch.enable (stage, true, true);
} "
contains 2 errors
"access to undefined property create.js".
Regards
Eve

ClayUUIDCorrect answer
Legend
December 20, 2019

His code is for an HTML5 Canvas document, which of course won't work in an AS3 document. No idea why he posted it.

 

On properly functioning touchscreen devices, you shouldn't even need to mess with the TouchEvent class for something as simple as clicking buttons, since the touchscreen driver should be presenting touch events to the operating system as simulated mouse events.