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

problem with the touch screen

New Here ,
Dec 18, 2019 Dec 18, 2019

Copy link to clipboard

Copied

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
 

 

TOPICS
ActionScript , How to , Publish package

Views

774

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
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 20, 2019 Dec 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.

Votes

Translate

Translate
Explorer ,
Dec 18, 2019 Dec 18, 2019

Copy link to clipboard

Copied

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);

Votes

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
community guidelines
New Here ,
Dec 20, 2019 Dec 20, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
LEGEND ,
Dec 20, 2019 Dec 20, 2019

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
New Here ,
Jan 10, 2020 Jan 10, 2020

Copy link to clipboard

Copied

LATEST

Thank you very much for your answer. The code is correct:
button_2.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToGoToAndPlayFromFrame);

function fl_ClickToGoToAndPlayFromFrame (event: MouseEvent): void {
gotoAndPlay (3);
}
?
I still have a problem playing the contents of the frames.
After pressing the button the appropriate frame is displayed. There is a movie clip with animation on it - unfortunately the animation no longer plays, it stops on the first frame of the mc. The problem is only with the touch screen.
Regards!
Eve

Votes

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
community guidelines