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

The three main hurdles to porting existing Flash projects to iOS with AIR

New Here ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

The purpose of this discussion is to identify significant problems currently preventing AIR for iOS from being a viable solution for porting existing Flash apps.  These issues have been largely ignored by Adobe, so I hope that everyone will add to this discussion if you have also run into these roadblocks in targeting iOS with the AIR SDK.  I hope that Adobe staff will address and provide some much needed information with regard to fixing these problems.

There are 3 main problems with targeting iOS currently, which are probably affecting anyone who is trying to port a project that is both medium to large in size and makes use of SWF loading.  Pretty much any project that has a MVC architecture is going to load SWF assets that are compiled against a view class, so this is likely affecting many people.

1. Bug - ADT packager runs out of memory when packaging "large" numbers of SWF assets

https://bugbase.adobe.com/index.cfm?event=bug&id=3511656

This is a blocking bug that prevents packaging projects with a large number of SWF assets.  It is preventing me from being able to package all the needed assets for my project.  I provided Adobe with my project to package a couple months ago so this bug can be reproduced in house and fixed.  The Adobe employee who was handling this never tried to reproduce the issue and has stopped responding to email and comments in the bug.  Adobe, please have someone take charge of testing and fixing this bug.  It seems like it would be a straightforward fix once the failure is reproduced within a debugger.

Has anyone who has encountered this problem determined the number of files or classes where it starts to fail.  I've spent some time trying to reverse engineer what the packager is doing when it runs out of memory, so think I can determine how many classes it's working with, but obviously the size of the classes will be variable and so this number will probably be more of a range where we start to get into the failure state.

Please let me know if you can reproduce this issue with your project with many SWF assets and upvote the bug if you are already aware of this one.


2. Bug - SWF reloading when doing a "real" (AOT) compile

https://bugbase.adobe.com/index.cfm?event=bug&id=3636385

There is already a forum post that covers the history of this issue (http://forums.adobe.com/message/4920638) but that also covers some issues in older AIR builds with loading of any SWF asset (previously fixed), where this bug deals specifically with reloading of SWF assets that include compiled bytecode (ABC).

The expectation here is that all versions of the Flash runtime should handle SWF reloading with ABC in the same way, so that a single codebase can be used to target web and iOS (or any other platform).  This is the only issue of the 3 that has a legitimate work around, in my opinion, because the assets can be cached within the app within a loading manager layer.  All the application code that makes loading calls can stay the same, and a compiler flag can be used to enable this caching for iOS builds, with subsequent requests returning a new instance of the cached asset.  This can potentially lead to a very bloated memory footprint for the running app after a period of time, though, which could make some apps perform poorly, so a bugfix is ultimately needed.


3. Unimplemented feature (?) - The constraint that a single ApplicationDomain is used when running AIR for iOS

I did ask about this in the same forum post as SWF reloading but didn't get an Adobe response.  Why does this constraint exist?  My guess is that the AIR runtime for iOS simply hasn't implemented multiple ApplicationDomain support at this point, and that this was done to focus resources on other high priority features for the iOS runtime.  It's possible that there is some aspect of the iOS operating system that makes it difficult or impossible to implement this feature, which may be why it's been avoided to this point, but obviously this is all conjecture without hearing from Adobe on it.

This is a major issue that needs to be addressed.  For us, the problem is that our SWFs for multiple instances of the same type of asset use the same name for the AS export.  For example, each item an avatar can equip is a single SWF with multiple sub assets -- the parts which comprise the item.  Each of the parts will have an AS export name based on the avatar facing and where it is equipped, like "fv_head".  This naming is consistent across all items, so we will load a lot of assets containing "fv_head" simultaneously.  This normally works fine because the default behavior for Flash has always been that each SWF is loaded into a new ApplicationDomain instance, but for iOS a single ApplicationDomain must be used, causing these names to collide.  The last SWF loaded containing a given AS export name overwrites the previous ones of that name.

The work around for this, and I use that term loosely, is to go through and uniquely name every AS export in every asset where sets of assets with the same export name is used. For us that is hundreds of items with multiple exports.  Maintaining unique naming across all these parts is also a very error prone process, not to mention all the code that manipulates the parts needs to be modified to handle the new naming and make sure it's referring to the now uniquely named assets.

The expectation here is that all versions of the Flash runtime should handle asset loading in the same way and place each loaded asset into its own ApplicationDomain container as the default behavior.  I'd like an Adobe employee to address my assumption that this is an unimplemented feature of AIR for iOS at this point, and let the community know if a solution for this will be implemented.

Summary

All three of these issues in combination are a major roadblock to porting existing Flash games to iOS with AIR.  Issues with one can make it hard to test and try to work around others.  All need to be fixed, but If I could only pick one of these to fix, it would have to be issue 3 -- that lack of proper ApplicationDomain support when loading assets.  This issue is completely inconsistent with standard Flash behavior and creates a major roadblock to ports of existing applications with no viable solution for a workaround.

I look forward to Adobe's feedback on each of these issues and hopefully fixes that will allow those of us working with AIR for iOS to get our products to market.

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
New Here ,
Oct 14, 2013 Oct 14, 2013

Copy link to clipboard

Copied

While this writeup is targeted to getting some feedback from Adobe on these issues, I'd really like to hear how many of the folks in the dev community are running into one or more of these problems.

How many of you are running into one or more of these problems?  Do you have a different work-around or some info that I haven't covered here?  Anyone given up on porting their existing product because of these bugs?

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
Adobe Employee ,
Oct 15, 2013 Oct 15, 2013

Copy link to clipboard

Copied

Thanks for bringing up the limitations on AIR of iOS platform on a common page. I want to let you know that 1st and 2nd issues are currently under investigation.

The 3rd issue/enhancement request is an AOT design limitation, because it cannot be known before hand (during AOT packaging) as to which domain a child swf will be loaded. Thus it has to be mandated that all loaded swfs be in the current application domain.

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
New Here ,
Oct 15, 2013 Oct 15, 2013

Copy link to clipboard

Copied

Thanks Varun.

Were you guys able to reproduce the exception thrown for the first issue (ADT bug) using the project I provided for packaging?  Please let me know if you need me to send the files over again.

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
Adobe Employee ,
Oct 15, 2013 Oct 15, 2013

Copy link to clipboard

Copied

We are trying to reproduce the 1st and 2nd issue at our end and will get back to you in case we need any more resources from your side to reproduce it at our end!

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
Adobe Employee ,
Oct 17, 2013 Oct 17, 2013

Copy link to clipboard

Copied

We were able to reproduce issue#1 at our end.

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
New Here ,
Nov 19, 2013 Nov 19, 2013

Copy link to clipboard

Copied

Hi Varun,

Could you provide an update please?  Were you able to also reproduce issue #2 with the code that Blakflag provided in the bug writeup?  Any progress on a fix for #1 at this point?

Thanks.

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
Adobe Employee ,
Nov 20, 2013 Nov 20, 2013

Copy link to clipboard

Copied

LATEST

I have following updates for the issues reported by you:-

  1. We are working on a new AOT engine which should be able to resolve issue#1.
  2. Currently not much progress has been made on this. We shall take it up once we stabilize the new AOT engine.
  3. As mentioned earlier, this is an AOT design limitation and we don't intend to fix it.

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
New Here ,
Oct 15, 2013 Oct 15, 2013

Copy link to clipboard

Copied

About the 3rd issue being an AoT design limitation, I'm not sure I understand why it's necessary to know during AoT packaging what the domain is that a child will be loaded into to be able to have SWF loading work as on the browser.

Isn't the ApplicationDomain an internal construct in the AIR runtime that you guys define in order to manage namespaces of loaded SWFs?  To be clear, when I say "runtime" I know that the resulting code isn't being interpreted within the iOS app, but clearly you have a set of AIR libraries that get compiled into the IPA that provides support for all the Flash APIs.  If that's the case, then wouldn't it be possible for the iOS version of the AIR libraries to define a new ApplicationDomain on the fly when code that has been cross-compiled to iOS native code loads a packaged SWF?

I don't have a clear picture of how ApplicationDomains are managed internal to the runtime of course, but a little more detail would be very helpful.  Thanks.

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
New Here ,
Oct 17, 2013 Oct 17, 2013

Copy link to clipboard

Copied

Thanks for posting this Antonio, #2 and #3 are definitely affecting me also. (I posted the bug about #2.)

Varun, thank you for letting us know the status of #3 especially. If it's an inherent limitation then I guess the only choice is to re-engineer to not depend on them. Unfortunate but useful information. I really appreciate the communication from Adobe.

I certainly hope some progress can be made on the first two issues, however! Thanks!

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