Using AS2 in Air Application

假如想象 提交于 2019-12-12 02:26:55

问题


I'm working on bringing a game over from Flash to Android using Air 3.2. The SWF I am testing with is an AS2 SWF.

I used this method to get the SWF file to load: http://www.mikechambers.com/blog/2008/08/18/anyone-using-actionscript-2-to-build-air-applications/#comment-13360

However, when I open the app, the SWF loads, but no code works. Here's the APK so you can see it in action.

Is there like a .SWC or something similar I can include to get the code to work?

Thanks, -Sandor


回答1:


What you want simply is not possible on mobile.

  1. On iOS, you cannot load AS bytecode in SWFs prior to AIR 3.6. You must package them at compile-time (loading at runtime is against iTunes Store policies and flat out cannot run) and the code in the embedded SWF is cross-compiled to Objective-C with the rest of the APP.

    Because there is no AIR Runtime in an app compiled for iOS (everything is cross-compiled to Objective-C), you cannot load in a SWF with bytecode, even if you do not plan to submit to the iTunes Store. There is no runtime available to actually run it.

    The workaround in your link will not work either since there is not and never was a flash player for iOS, which that relies on

  2. On Android, the AIR runtime is AS3-only. There is no support whatsoever for loading AS2; that runtime simply does not exist.

    Additionally, the little workaround mentioned in the comments of your link will not work either. That workaround relies on the device having Flash Player installed to run the SWF. Adobe dropped Flash Player for Android a few years ago and no device has been able to install it since then. Odds are only a fraction of a percentage of all Android users still have Flash on their phone.

So there is no way to do what you want. You must convert it to AS3 or not support Android and iOS.



来源:https://stackoverflow.com/questions/24985261/using-as2-in-air-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!