Highlighted

problem with the touch screen

New Here ,
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
 

 

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

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.

TOPICS
ActionScript, How to, Publish package

Views

167

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

problem with the touch screen

New Here ,
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
 

 

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

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.

TOPICS
ActionScript, How to, Publish package

Views

168

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

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
Reply
Loading...
Dec 18, 2019 0
New Here ,
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

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
Reply
Loading...
Dec 20, 2019 0
Adobe Community Professional ,
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.

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
Reply
Loading...
Dec 20, 2019 0
New Here ,
Jan 10, 2020

Copy link to clipboard

Copied

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

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
Reply
Loading...
Jan 10, 2020 0