On Touched Object Event Fires Twice on Android via Crosswalk

Bugs will be moved here once resolved.

Post » Sun Mar 09, 2014 9:31 am

Problem Description

On Chrome on Windows, On Touched Object fires Once.
When exporting the project to Android via Crosswalk and opening in XDK or opening the APK on Android, the On Touched Object event fires twice.

Attach a Capx
https://dl.dropboxusercontent.com/u/614 ... h_bug.capx

Description of Capx
There is one layout with one sprite, and one event in the event sheet.
When the sprite is touched, the browser displays an alert.
Once on Windows, twice on Android.

Steps to Reproduce Bug
  • Open the capx in Construct 2
  • Run the project
  • Click the sprite
  • See that there's one alert displayed
  • Create project in Intel XDK and Export to Android via Crosswalk
  • Emulate in XDK or build the APK and install it on Android
  • Touch the sprite again on Android, either in XDK or on actual device

Observed Result
Browser displays TWO alerts.

Expected Result
Browser displays ONE alert, just like on Windows and just like I would expect it to, because I only touched once.

Affected Browsers
  • Chrome: (Only in Android via Crosswalk)
  • FireFox: (NO)
  • Internet Explorer: (NO)

Operating System and Service Pack
[*] Intel XDK 0505 (I think, not sure where to look, I believe it's the latest).
[*] My Android phone, Android 4.1.1
Construct 2 Version ID
Release 158.2 64 bit
B
14
S
5
G
8
Posts: 235
Reputation: 5,675

Post » Sun Mar 09, 2014 8:05 pm

I am having the same problem.
B
5
Posts: 19
Reputation: 770

Post » Sun Mar 09, 2014 8:31 pm

In the Touch object, select mouse input to Off and give it another go. Certainly with phonegap you get double triggers if the mouse input is enabled and I suspect it's the same here as well (I haven't the time to test it through to completion using the xdk). I only use the mouse input for debugging on my computer....
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Mon Mar 10, 2014 6:48 am

Thanks @Colludium, turning mouse input off on the touch object fixes it.

I still think it's a bug :D, and there's a slight inconvenience to remember turning it on and off all the time (when testing on the desktop vs the device) but the workaround does work, so that probably makes it a lower priority bug.

Cheers!
B
14
S
5
G
8
Posts: 235
Reputation: 5,675

Post » Wed Mar 12, 2014 8:26 pm

You should not use 'alert' to test things like this: some browsers have bugs in the alert dialogs that can cause events to mis-fire or switch focus in unexpected ways. Please repost a repro .capx which does not use alert.
Scirra Founder
B
387
S
230
G
88
Posts: 24,250
Reputation: 192,452

Post » Fri Mar 14, 2014 6:28 am

Thanks Ashley.

I only used alerts in the small demo I made to repro the bug. In my real project I don't use alerts, and it still gets fired twice, that's how I found the bug.

Cheers!
B
14
S
5
G
8
Posts: 235
Reputation: 5,675


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests