From SWF to AIR to iOS application
Asked Answered
S

3

7

I have existing Flash application, which compiles to SWF and runs on web. I'm looking at converting that application to work on mobile devices such as iPhone/iPad.

I see that there is now a way to publish Adobe Air applications on mobile devices. My thought is why not convert SWF to AIR application and then use that AIR application to publish on mobile devices. Does it make sense? Is this even possible or doable?

What are people doing to convert their existing Flash SWF applications to work on mobile devices?

Shun answered 19/7, 2012 at 1:22 Comment(1)
I thought Apple does allow it. youtube.com/watch?v=_hkfOk8P79sShun
G
3

This question was just answered here, but to recap any Flash content can be packaged to iOS or other mobile device with AIR.

AIR can be overlaid to Flash Professional or Flash Builder, or your SWF can be packaged using the ADT command line packager:

  • Download AIR 3.0 SDK.
  • Assure JRE, or use the one from Flash Builder.
  • Execute adt to package your SWF to an IPA:

    adt -package -target [ipa-test | ipa-debug | ipa-app-store | ipa-ad-hoc]
        -keystore iosPrivateKey.p12 -storetype pkcs12 -storepass qwerty12
        -provisioning-profile ios.mobileprovision
        HelloWorld.ipa
        HelloWorld-app.xml
        HelloWorld.swf icons Default.png
    

It's important to note that all executable code must reside in a single SWF to run on the iOS platform. SWFLoading or any dynamically loaded SWF that executes code is not supported. So, link all your Flash to a single SWF.

There are other considerations, such as optimizing performance and handling multiple screen resolutions and aspect ratios.

References:

Gyimah answered 19/7, 2012 at 2:31 Comment(1)
Talking about performance optimizing, I'd recommend using the current AIR 3.3 SDK as it performs significantly better than previous versions.Afar
B
2

There are a few ways to achieve this:

  1. You can download Adobe AIR SDK, and follow their help or this tutorial. This method would be a bit tedious if you are not comfortable with command line, but it is perhaps the most powerful option because you get to tweak and control a lot of options.

  2. If you have the FLA file, the latest version of Flash CS6 should provide you the means to create IOS IPA file more effortlessly. If you are a Windows user, you would need to get the p12 file as well as mobile provision file. Adobe has documentations on how to do that without a Mac. Eventually when your IPA is ripe for AppStore, you would need a Mac.

Keep in mind that the user experience of an SWF would not right away translate well for iOS. For example, the size of buttons, the affordance of interactive user controls, and most importantly, mouseover events could sometimes adversely impact the experience of a mobile app.

But those problems have nothing to do with SWF, as I have seen similar issues with other HTML-based web apps too.

Good luck, I would say writing Flash and it runs everywhere including iPhone/iPad is truly an amazing thing that most people don't know.

Bibliotheca answered 19/7, 2012 at 2:39 Comment(0)
S
2

I have been doing this exact thing for a year or so.

You do have to set up your certificates using the keychain on the Mac, and you have to upload the app from a Mac. However, I do not have a Mac . . . instead, I rent time on a remote Mac using (macincloud or others), and use DropBox to send the files back and forth.

Depending on how the SWF was created, you do not necessarily need to buy Adobe products. I use FlashDevelop, which sets up the latest Air and Flex SDKs automatically. As long as you have a developer's license, you can create the Air application from that, and you can also create the IPA file for loading into iTunes (or Google Play, or others).

Make sure you have read @JasonSturges response as well. Good tips and links.

Socinian answered 19/7, 2012 at 4:12 Comment(2)
So do you have one code base that compiles to SWF and mobile application? Or do you have two code lines, one for generating a SWF and another for mobile app? I'm guessing it would be latter.Shun
No, it's one code base, but there are "alternate endings", you might say. I compile with Flash IDE, and use compiler conditionals (APPDEV::forIOS (can actually be any valid const name) set to true or false) to exclude sections of code. I think you can do this with the ADT commandline as well (-define=APPDEV::forIOS,true or -define+=APPDEV::forIOS,true, and some setup code in the XML file), but have never tried it, since I also use the grx capabilities of Flash.Socinian

© 2022 - 2024 — McMap. All rights reserved.