Skip to main content
Inspiring
June 11, 2011
Question

Touch events don't work on an actual device?

  • June 11, 2011
  • 2 replies
  • 1737 views

I'm posting here because I'm not sure where else to put it.

I have a (semi) functioning prototype of an app and am trying to test it on an iPad.

But when I export and install the ipa on my iPad through iTunes and Launch, most of the functionality is gone. In fact, all that happens is my buttons light up. Nothing does anything else.

I'm (hoping) I'm just missing something simple like a publish setting wrong.

Player: AIR for iOS

Script: Actionscript 3.0

Included .swf, .xml, and all relevant .as class files

Published using quick publish for device testing

And that's it. I opened the .ipa in iTunes and synced. And nothing works.

What am I doing wrong?

This topic has been closed for replies.

2 replies

AmbariAuthor
Inspiring
August 29, 2011

I am going to copy and paste this answer into all of the forums I've asked this question in case some noob like me comes along and needs the answer.

I found the problem! After 3 months I finally figured out what was wrong and why my app was working in Device Central when exported as Flash 10.1 and not on my iPad when exported as AIR for iOS.

The problem is that in the Flash runtime, if a line of code returns a bug, the flash runtime says "Error, shmerror, try again next time." So I had one if, else statement that was executing when it wasn't supposed to be - only once, at the very beginning of the program. It was throwing an error. When I exported as Flash, flash didn't care, and still executed the code later when it was supposed to. But Apple won't let their programs crash. So instead of just trying that code again, Apple decided, after the first error was thrown, that it would then COMPLETELY IGNORE that line of code. So the error was in the line where the states would unhighlight themselves. Apple just shut down that line of code, that's why it wouldn't execute properly.

I ended up changing this line of code

if (lastObjOver != null && lastObjOver.isLocked == true)

which threw an error when the piece was FIRST dragged over the puzzle, to to this

if (lastObjOver.parent != null && lastObjOver.isLocked == true)

which wouldn't throw the error.

Problem solved!

If anyone else is having this problem, I suggest you do what I did. Change all your touch events to mouse events so you can run the program in the adc debugger. That's when I discovered the error being thrown.

kglad
Community Expert
Community Expert
August 29, 2011

in the future, whenever you post an issue to the adobe forums AND you're seeing an error message:

click file/publish settings/flash and tick "permit debugging".  copy and paste the entire error message along with the problematic line of code mentioned in the error message.

AmbariAuthor
Inspiring
August 29, 2011

Thanks! I wasn't seeing the error message before. It only showed up last night when I changed everything to mouse events. It only took me about 5 minutes to find the problem after I found the error message.

Thanks for the tip!

relaxatraja
Inspiring
June 13, 2011

Show you code! are you packaging with AIR 2.6?

AmbariAuthor
Inspiring
June 13, 2011

You want me to copy and paste my entire program here? Why? There's multiple classes, it's probably hundreds of lines of code. If there is something in the code that's not working (i.e., some part of actionscript is unsupported by the packager) it needs to be on a list on a website somewhere so developers can say, oh, well, I won't use .parent in my program because the packager can't handle it. It's a fairly straightforward program, it just only works on the emulator.

Yes, AIR 2.6 and packaged using AIR for iOS. I'm getting frustrated about this issue, not at the forums, but at Adobe. I've emailed, tweeted, and opened support cases to send to them. Their only response was, "We won't help you ask someone else." Yet there is no one else to ask. I'm not quite sure what to do. I'm about to switch back to XCode if I can't rely on the AIR for iOS compiler to actually work as advertised. If there's something simple wrong with my settings and Adobe refuses to help people with questions then there should be a video somewhere that explains how to package for iOS. I watched the only video available on devnet and it was wholly unhelpful as it told me to do exactly what I had already been doing.

relaxatraja
Inspiring
June 13, 2011

if possible send the files to relaxatraja@aol.com