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
What you want simply is not possible on mobile.
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
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.
Related
After further researches, I found that for making android apps with AIR technologies, it requires AIR runtime on the android device, and Flash professional CS5, then, youn can publish your flash project under apk extension, even install it as an android application automatically after publishing it, if you are connecting your device via usb cable, and you are already installed the sdk tools with the usb connector package if you're on windows.
So all of this is great, but, I only have the apk extension of the app, with a file called main.swf, i want to know that if I use the Flash professional cs5 to open the main.swf file, will I be able to modify fields labels for example, and then translate the labels from english to french ?. if not, what is the right way to translate an app made by Flash, when you only have the apk decompiled of the application containing the swf file ?
Thank you for your answers, i'm here if you need any further explainaitions about my situation.
I searched for alternatives to restart my android application, but the only way I found to reboot is build with Flex.
Can i restart my android adobe air app with as3 flash? How i do it?
You can't do it with anything built into Adobe AIR on mobile. The capabilities of AIR are extremely limited compared to native applications. You would have to build an AIR Native Extension (ANE) to handle it. Worth noting that I don't think this is possible at all on iOS (natively or otherwise), so if you are deploying to both you would need to account for this. This would likely also be the reason why you can't do it in AIR for Android, as AIR for mobile tends to appeal to the lowest common denominator. If one can't do it natively, it is likely Adobe didn't include it for the other.
See this question on how to do it natively:
how to programmatically "restart" android app?
Is this even possible with version 4.4.2 now? I had tried to use webview to load swf file on android application but it does not work. Can someone verify this?
Using Flash in Webviews on Android has not official been supported for a while. It sometimes works on older (4.0 and older) Androidversion where the flash plugin still is installed but the reach is constantly decreasing and I wouldn't recommend using it.
To deploy flash applications on your mobile device you might be able to use AIR though:
http://get.adobe.com/de/air/
I am trying to build an application where the webview should handle flash contents.
As most of us are aware of, Adobe has announced it will not support Flash Player browser plugin for Android 4.1 and onward.
Without installing Flash, is it possible to realize it?
I did my part of researches and came along with Captive Runtime where you can have the flash package inside your application, without the need to install flash.
My question is, is it possible to build an android app without using Flash Builder, and have the flash package inside?
Is Adobe Air the only solution in my case?
Thanks in advance!
Adobe AIR is the one and only hope. You don't need FLASH here in this context. Make sure you have the Flash Builder 4.6 to build the application, test it with the inbuilt emulator to see how it all goes.
Froyo and Flash Player are coming to our phones.
In the Adobe PreRelease programs we can find AIR beta for Froyo and Eclair. With that, I can develop a Flash app and export it to my phone.
So, is AIR player the Flash player? o_O
I can't understand what differences are between AIR and Flash on Android.
Can you help me? Thank you!
Flash and AIR work just the same on Android as they do on the PC - similar technologies, but Flash plays in a browser and AIR apps are used like native applications. In other words, to use an AIR app, you'll typically install it from the Google Market, and put a shortcut to it on your homescreen, then launch it and use it like any other application. Whereas for flash content, you'll follow a link or a bookmark, and see the content embedded within a web page.
Anyway the capabilities of the two engines are similar (AIR does basically all that Flash does, and adds on some extra features suitable for applications), but the difference is in the way you access and use the content.