Convert Flash to iOS app - ios

For the record, I am an iOS developer, and have absolutely no background on how flash programs work/run/developed...etc.
I have a Flash program that is mostly a collection of SWF files. It does, however, contain some Actionscript, Javascript and other integrated languages here and there..
I would like to convert this project/program to an iPad application. Is it possible?
What I got from searching the net:
Converting Actionscript to LUA script
Using Corona SDK to port the program to iOS
Starting a new iOS project in flash and moving the code somehow..
Other tedious ways which are not feasible at all....
The above mostly handles the actionscript part .. what about the SWF files?
As a last resort, one could at least guide me to a developer/company who can handle this task, or provide training to accomplish this.
Additional details
The flash program app file is already generated, and the program works on desktops perfectly. The program is somehow an interactive e-book, and it has some linked XML files to index the table of contents and other sections...

I've not done a lot of iOS development yet, but here are my experiences so far; maybe they help you form a better idea.
Only the main SWF can contain actionscript code.
I'm not sure how far assets (Sounds, Fonts, MovieClips) in other SWFs which are exported for actionscript are accessible to the main SWF.
It is possible to include additional XML files (and other types) which can be loaded via the normal loader classes.

Recently I came acrosshe tool which allows you to convert and play swf to some cross-platform frameworks. Now they support only Cocos2d-x, Unity 3d and Starling. But I saw the logo of Corona on their homepage. You can go there and ask them. I don't remember the right name of the site, but tool is called GAF converter

Related

Difference between a Flash SWF file and a Flash SWF compiled for use on iOS

SWF files compiled for the Flash & Air (desktop) can be easily de-compiled with off the shelf software.
However, SWF files compiled for iOS are different. The header is FWS, yet the data in the file wont de-compile in any de-compiler.
I am guessing that something happens during compilation for iOS. Does anyone what this is?
Thanks
To the best of my knowledge, you won't be able to do this.
A compiled AIR for iOS file is cross-compiled to Objective-C. Apple does not allow for virtualized languages in the App Store (which is how AIR for Desktop and Android work), so this was Adobe's solution. They take your AS3/Flex and translate it to Objective-C at compile-time so that at run-time, you are actually running native code.
So you would have to decompile the Objective-C first. Then you would have to reverse-engineer the entire AIR compiler and write a way to re-translate the decompiled Objective-C back to AS3.
For the record, any questions about decompiling binaries is generally frowned upon on SO.
did you try this sothink flashdecompiler?
And there is a Mac version that can help you out in it. here

AS3 Multiple Application Domain using local null.swf file

I have the following issue, I cannot find a solution on the web, please let me know if you can help me or point me to a proper info about this issue.
To understand the background, Im porting a game from flashDevelop to Flash Builder (please dont give me tips about this comment if doesn't help to my particular problem). Everything works fine right now, the game use a file null.swf as a container of local files (I don't undertand that part completely, but the game has a lot of embed swc files, and the game use the null.swf to access those files, through LoaderMax).
The problem is that everything works fine with a fast build, but it's not working with a standard build, I have the error on Loader class that says "Multiple application domains are not supported on this operating system".
Useful information:
Im using AIR 3.9, compilation flash swf-version=20 (I had 18 when I started with this issue)
null.swf is properly included on the IPA, the code recognize the file, and as I said before it works with a fast build.
For embed swc files, I had to include the files with a compiler argument: "-include-libraries ../../filename.swc ../../filename2.swc etc.."
Thanks for any help.
Regards
It's fixed, using a context:
context = new LoaderContext(false, ApplicationDomain.currentDomain, null);
If I use the third parameter, like ..., SecurityDomain.currentDomain); it doesn't work.

Using Shared Object File in iOS (.so file)

I have been given a Shared Object file (.so) and the functions inside of it, but I don't have a clue as to how to use it, or alter it for use in an iOS application. Could someone point me in the right direction?
I know the .so came from an Android application, but I was told I could get it to work in an iOS application as well.
Actually and technically, yes, you can, but not in a way you would ever think.
If it came from Android, it is probably compiled for ARM. So it should be binary-compatible with the ARM CPU in iOS devices. However, iOS doesn't use the usual format of shared objects (that is, the ELF format), but iOS' and OS X's own Mach-O format.
This means that you cannot directly link against this shared object file nor are you able pass it directly to dlopen() and dlsym(). You have to get into serious hacking (something that you probably don't know). This involves loading and relocating the file properly.
An example of this can be found in iOS jailbreak developer and hacker, Comex's GitHub repository Frash, a Flash player for jailbroken iOS devices. Comex essentially wrote an ELF loader module (dubbed "food") for iOS and used it to make Android's libflashplayer.so work on iOS. Pretty neat, huh?
Also note that this is not going to be possible for AppStore apps as it needs dynamic loading and various alterations in the OS.
while technically possible (see h2co3's answer) for anything practical the answer is no
so files arent in the correct binary format
even if they were, dynamic loading is not allowed by appstore

Loading 3D model in iOS

I'm creating a game application from scratch with xcode for iOS, and I've use the OpenGL Game projet template to create mine.
I've searched a lot in the past few days, but I can't find any tutorials or example as to how I would load 3D model (via .obj files) in my application. I've found some documentation on loading them onto an app with a console script, but I need to do it programmatically.
Any help would be very appreciated
Also, my 3D models are created using blender
The future will be here momentarily — SceneKit, available in OS X since v10.8, will be in iOS 8. It can build and render a scene with COLLADA (.DAE) models directly. No need for third-party tools or code, nothing complicated to learn.
Apple's documentation is pretty good but if you prefer then other tutorials are available.
OpensceneGraph has support for iOS and a lot of prebuilt code which can help you develop the game. It supports loading OBJ models.
I recommend to use an Engine (like isgl3d, nineveh, Cocos3D, ...) for creating a 3D game, it will be hard if you use Opengl for a start.
Note: you can search for a list of game engine to choose the suitable one for you game, cause there is a lot of game engine, open-source or paid engine.
You can download the zip file from here and then run ./obj2opengl.pl 3DModel.obj in terminal .It will give you 3DModel.h file as output.
You need to use glDrawArrays instead of glDrawElements as the .h file contains array.
Obj files are simple to parse and are well described on wikipedia. You should be able to load them in one or 2 hours. But if you want to load the materials you need to invest some more time in your engine and into loading the obj file.

Is it possible to embed an existing SWF into an Air for iOS app?

One of my customers has many SWF and he would like to port them to iPad. However, he only has the SWFs, not the FLAs.
I 'd like to know if it is a way to run the SWFs inside an Air for iOS app. I´ve read you can import then with a Loader, but they will only run as an animation ignoring all the code inside them.
Thanks, any help is welcome!
[UPDATE] I´ve read something about using SWC, but still not sure if they will run the code.
Update, Oct 2012:
In Adobe AIR 3.5, adl is introducing a feature called "multiple SWF support" that allows the use of Loaders to load SWFs delivered in the .ipa (local files, not from servers) to have code in them. The adl compiler AOT compiles SWFs that are included in the .ipa, allowing them to be loaded and work under iOS.
AIR 3.5 is currently in beta at the time of this writing, available on the adobe labs site:
AIR 3.5 on Adobe labs website
AIR 3.5 release notes
Note that this feature requires -swf-version=18 or greater of the root SWF (not necessarily the assets being loaded) and AIR namespace ending in 3.5 in the application xml file.
Older answer:
The reason external SWFs with code in the doesn't work is that Air's ADT compiler cross-compiles your root SWF (and only your root swf) into objective-c code consumable by an iOS device. Both [embedded] SWFs and those included in the .ipa (prior to AIR 3.5) are not cross-compiled.
I created a workaround for this problem for embedded assets:
[Embed(source="gameLevel.swf")]
private var gameLevel:Class;
...
addChild(new gameLevel());
In this scenario, if gameLevel.swf has code in it, it typically wouldn't work in iOS, because new gameLevel() would create a Loader and interpret SWF bytecode. But, if you first run the above SWF through my tool called SWFMerge, it will take your embedded SWF and merge it into your root SWF. The result is that ADT will compile your embedded code into objective-C, it will work on iOS, and note: new gameLevel() now results in an instance of your asset - NOT a Loader.
The SWFMerge tool is here:
http://www.onetacoshort.com/temp/SWFMerge_alpha.swf
LMK if this workaround works for you or if you have trouble. Cheers!
-Jeff
Yes you can,
Apple does not allow your application to download SWF's using Loader from the internet but you ARE allowed to embed and include them inside of your .ipa
To do this you would use the embed tag
[Embed("myswf.swf", mimeType="application/octet-stream")] private var mySwf:Class;
You can then use
swf = new mySwf();
swf.addEventListener(Event.COMPLETE, completeHandler);
And interact with the swf inside that complete handler
I wanted to add to this that it is possible to compile a SWF that is not able to be loaded

Resources