From SWF to AIR to iOS application

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 notconvert 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?

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:

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.

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 (macincloudor 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 useFlashDevelop, 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.



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. –   dev.e.loper Jul 19 '12 at 4:19 
1  
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. –   iND  Jul 19 '12 at 4:29

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. –   dev.e.loper Jul 19 '12 at 4:19 
1  
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. –   iND  Jul 19 '12 at 4:29
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: "gst-launch-1.0 playbin uri=file:///path/to/file.swf" 这句命令是使用 GStreamer 命令行工具 "gst-launch-1.0" 来播放一个 SWF 文件。 "playbin" 是 GStreamer 的一个预定义的播放器元件,它可以自动处理所有必要的播放步骤,如解码、渲染和音频输出。 "uri=file:///path/to/file.swf" 设置了播放的文件的 URI,在这里,是本地文件 "file.swf" 的路径。 ### 回答2: gst-launch-1.0是GStreamer多媒体框架提供的命令行工具,用于构建和运行多媒体处理管道。playbin是一个内置的元素,用于处理音视频文件的播放。在上述命令中,我们使用playbin元素来播放一个文件的URI,URI指向一个.swf文件。 URI是统一资源标识符的缩写,用于唯一地标识一个资源。在这里,我们使用URI指向一个.swf文件。file:///表示文件协议,意味着文件位于本地计算机上。/path/to/file.swf是.swf文件的路径。因此,该命令的目的是使用playbin元素播放指定路径下的.swf文件。 GStreamer提供了灵活强大的多媒体处理功能,并支持各种音视频文件格式和协议。通过使用playbin元素,我们可以轻松地实现音视频文件的播放功能。此命令将自动处理文件的解码、播放和显示,并根据文件的内容和编码格式进行必要的配置。 要运行上述命令,我们需要在终端中输入"gst-launch-1.0 playbin uri=file:///path/to/file.swf"并且将"/path/to/file.swf"更改为.swf文件在本地计算机上的实际路径。然后按下回车键即可启动该命令。在成功运行后,GStreamer将根据指定URI播放相应的.swf文件。 总而言之,使用gst-launch-1.0 playbin uri=file:///path/to/file.swf命令可以轻松地实现在本地计算机上播放指定.swf文件的功能,通过GStreamer提供的多媒体处理功能,我们可以处理各种音视频格式和协议。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值