Tag Archives: air

Bizarre Variable Naming Issue With iPhone Packager for Flash

I posted the other night about my difficulties with Adobe’s iPhone packager for Flash, the program that lets you convert a Flash app into an iPhone app. I’ve managed to track down at least one of the issues that’s been eluding me, but it’s a doozy.

If I name an embedded bitmap resource “sprBatteries,” the app hangs at startup on the iPhone.

I can name it “sprDryCells” or “sprBatteriesX,” and it works fine. I can replace the resource PNG with a PNG I know works elsewhere, but if I name it “sprBatteries,” the app hangs. The app runs fine on my desktop. I believe (although I haven’t done systematic testing to confirm) that it works on the iPhone if I compile it as a simple AS3 app using the Flex compiler instead of compiling it as an AIR app. The resource variable name doesn’t collide with any others in the project.

If you’re not a programmer, let me explain that this behavior is bizarre. Variable names are totally arbitrary. As long as you don’t use any prohibited characters, you can name a variable anything you want. A college friend of mine liked to call his loop iterators “taco.” Many languages/compilers won’t even bother remembering the variable names once the source code is turned into a program. Flash happens to record theirs in the compiled SWF for various reasons, but there’s no sensible reason why “sprBatteries” should be treated differently than “sprBatteriesX.”

I give up on AIR for iPhone unless someone can get me a solution. I’ll see if I can get this running in simple AS3 without any hardware APIs, but it’s unlikely that my final product will contain any accelerometer input (for example). This is frustrating, and I’ve spend a total of over 12 hours fighting with this thing. Adobe hasn’t represented this as a finished product, and rightfully so. In its current form (and assuming I haven’t overlooked something simple), the Packager for iPhone is not ready for use in serious AIR development.