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.

12 thoughts on “Bizarre Variable Naming Issue With iPhone Packager for Flash

  1. That reminds me of some of the issues I had with Construct; problems that simply made no sense at all, that followed no logical patterns and could thus not really be fixed. It’s a recipe for madness, and it might be wise to work on something else instead.

    1. I would love to, but I can’t seem to find a bug reporting form for Adobe Labs products. I left a topic on their forum, though.

      Honestly, though, Adobe’s one of those companies that doesn’t respond to bug reports, which makes me very reluctant to give them any.

  2. I once encountered a situation where the text inside a comment could cause a build to fail, in a plain Flex project. (Not Air.) :P

  3. Adobe responds to bug reports. They just have turnaround times which are so long as to be useless. Some examples:

    Granted, none of those are showstopper we’re-all-gonna-die bugs, but I don’t think it’s asking too much for a company of Adobe’s resources to devote enough time to merely triage issues in one of their flagship products such that said triage does not take anywhere from 28 days to 6 months. (Or, if they are doing triage quickly, they could at least keep the bug reporter informed. Like other decent open source projects do.)

    Anyway, just to prevent this comment from being entirely an Adobe rant — have you tried replicating this behavior in a new project? Doing so would lessen the possibility that it is in fact the variable name causing problems (which, yes, is bizarre) and would increase the likelihood that that particular name plus some other circumstances (sorry I can’t say what they might be) is triggering an erroneous build.

    1. I see; thanks. I was basing my assumption on a page where Adobe stated that they did not have a policy of responding to bug reports. I was also entirely unable to find the bug tracker you linked me to on my own. Bad website design, I suppose.

      I haven’t tried replicating the behavior; what I need the tool for is this specific large project, and I’ll be adding a lot more (legacy code!) to it. Something I glossed over above is that there are three different embeds that seem to be causing the same problem. I could do more investigation, but I’m burned out on this task for now.

  4. All of the names which you say work have exactly two capital letters. All of those which you say do not work have exactly one. Does this pattern extend?

  5. Have just discovered same type of behaviour with class spark.effects.animation.MotionPath

    If I use it — blank white/black screen. I thought there’s something inside it, so I created my own one with the same name and package and compiled this one instead Flex Framework’s ones — same thing. So that’s only the name.

    Have you found a place where to submit it? Even though they ignore everything & everybody…

Comments are closed.