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

Touch events in Animate

Enthusiast ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

Hi, all.

In my previous apps I've used mouse events, but for my latest I've decided to go for touch events, mainly because mouse events don't work if you accidentally touch the screen with a finger holding your device while tapping a button with the other.

However, I'm using Animate and have to activate the touch layer on the simulator each time I test the app.  Does anyone have a best practice on dealing with touch events in Animate? Btw I'm using a PC. It would be nice to be able to change the default settings for the simulator, so it opens with a touch layer and turns it's alpha down.

TOPICS
Development

Views

1.6K

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 ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

As far as I know there isn't a way to make it default to that. I sometimes have both touch and mouse listeners, and a variable to say which I'm using. That way I can test with a mouse, then switch to touch for testing on devices.

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
Enthusiast ,
Jan 17, 2019 Jan 17, 2019

Copy link to clipboard

Copied

Colin, I've thought about doing the same, but isn't it an extensive task to clean up all the mouse listeners + functions when you finally deploy the app? I guess it depends on how complex the app is, though.

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 ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

I leave them in. They're doing no harm.

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
Enthusiast ,
Jan 20, 2019 Jan 20, 2019

Copy link to clipboard

Copied

True Except for a larger code, though. You would have double up of every listeners and corresponding functions.

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
Explorer ,
Jan 29, 2019 Jan 29, 2019

Copy link to clipboard

Copied

I just compile to the iPad from Animate every time. I think that testing multi touch is much easier when you are using a real device instead of a simulator. Setting the Device deployment type in Animate settings to "Device testing in interpreter mode" makes in compile really fast.

However sometimes I wan't the app to act differently in windows. I have a static class "Project". When I initialize the class I just determinate if the app is running in windows (running simulator) or not.

Like this:

import flash.system.Capabilities;

------

var myOS:String;= Capabilities.os.toLowerCase();

if(myOS.indexOf("windows ", 0) >= 0) {

     isSimulator = true;

} else {

     isSimulator = false;

}

Then I can just call the static variable Project.isSimulator before adding code that should only work in the simulator in windows.

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
Enthusiast ,
Jan 29, 2019 Jan 29, 2019

Copy link to clipboard

Copied

Rolf_Rahbek, thanks for your suggestions. Compiling to a device is a good option, however while debugging I find it easier to test from within Animate being able to check the Output and Compiler Errors. When testing on a device I use Scout, but it's a bit cumbersome to track down errors.

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
Explorer ,
Jan 29, 2019 Jan 29, 2019

Copy link to clipboard

Copied

OK, but you can still get your traces and runtime errors in the Output in Animate when the app is tested on the iPad.

In Adobe Animate: Just select "Debug" in the main menu, then 'Debug movie" and then choose you iPad.

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
Enthusiast ,
Jan 29, 2019 Jan 29, 2019

Copy link to clipboard

Copied

LATEST

True, but the app tend to crash after a while when I do that. Might have to do with my computer, though, or perhaps something in the settings I've overlooked. I think I'll explore it a bit more.

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