Publishing Flash based content for iPhone, the right way.





iOs Dev Center settings:
- Before developping games for App Store, you must have a correct and unique Ios Developper Account on iOs Dev Center page. (google it!!!) After you created this account, go to iOs Provisioning profile and step the standard procedure for creating a distribution and a developper certificate. What you must understand is that with your developper certificate you can only developp, and with your distribution certificate you can only distribute.
- So, after creating your certificates, register your developping device, by going to "device" portal.
- Go into your mac, to KeyChain Access and export your .p12 files. Save the distribution certificate with "distributionCertificate", and the developper key with "developperCertificate".
- After creating your .p12 files, create your application unique ID.
- Go to Provisioning profile and create other 2 profiles, using your application ID created above: a developper profile saved with "MyAppNameDevelopper" and a distribution profile saved with "MyAppNameDistribution". Download theese two profiles into your computer.

Flash CS.5.5 exporting settings:
Pay very much attention to this stuff, because of this things a lot of errors may happen: when you export your flash file for testing, use the "developperCertificate" and the "MyAppNameDevelopper" distribution profile. In Publish Settings, in the iOs deployment type select "Deployment – Ad Hoc". Attention, for running, your application must have all the required icons. Don't try to upload this application on App Store using Application Loader because it won't work. Also, this application it will not work on any other devices but those who are registered in the "Device Portal" before submitting your developper Profile. So, if you want to test your application on some other device, let's say your neighbour's iPad, then your must first register your neighbour's iPad on your Device Manager, then modify your developper profile, download it again, and publish your application again. when you export your flash file for distribution on App Store, use the "distributionCertificate" and the "MyAppNameDistribution" distribution profile. In Publish Settings, in the iOs deployment type select "Deployment – App Store". Don't try testing this application on any device, because it will never work. This application will work only on Application Loader when you are going to publish it. Another common error when working flash based content for iOs is that your application for distribution may not work properly. Let's say that you tested your application for two months, and you feel like now it's time to publish it. And you do it. And they accept it. Then you receive a call from a costumer that is saying you: "Dude, your application has only one frame!", or "Dude, there are no sounds in here!". The only thing you can do after publishing for app store, before submitting to Application Loader, is closing your Flash CS 5.5 and testing your .swf outside it. Just open it with Flash Player. You may receive some "Dismiss" errors for file path, or you il see that your last published version it was not properly exported so that dude was actually right Application Loader common errors: Never mess up your certificates: your Distribution profile works only with your distribution certificate. And your developper certificate works only with your developper profile. The most common error when you upload your application on App Store is "Application failed codesign verification". This is always happening because of your certificate, profile or deployment type mismatch. Anyway, you may also receive a lot of errors because of this mismatch. Of course, if you receive the following error when uploading your application, “An SSL error has occurred and e secure connection to the server cannot be made”, it means that your internet connection works very slow.

Developper tips for Flash based content for App Store:
- always remember that your .ipa is a package, and inside it there is a lot of stuff, but to .swf file. So, i reccomed you not to use external .swf file.Your developping folder is influencing your exported .ipa file, so if you have unsed icons or any unused files, delete them all. If you are going to extract your .ipa on a Mac, you will see that your package still have files that you are not using anymore, and may influence your application.
- Instead of using "Ctr+Enter" use "Ctrl+Shift+Enter". Yes, debugging is the secret.
- Avoid using Flash transition classes, like import fl.transitions.Tween , or import fl.transitions.TweenEvent. Is better to use TweenLite, and is perfect to not use any code based tweening method at all.
- use 34 bits sounds, and avoid using SOUND_COMPLETE listeners. They are not always working properly. A good practice is to check if your sound sampling is the same as the one selected in Flash Publish settings.
- When you are using linkage for accesing movieclips, don't let empty graphics into your movieclip. Each imported movieclip must have inside it another movieclip or another graphic. You can't just draw it, because it if possible your iPad not to show that color. Best advice is to convert your graphics to bitmap.
- Avoid using ENTER_FRAME events. Try the Timer Class.
- in try..catch, use only "Error" object. It seems that iOS does not recognize other error types.
- Create "reusable" variables and functions. Avoid declaring variables inside a function. - Don't use Capabilities class inide your Iphone application. Capabilities are only for Android, Windows, Mac... but not IPhone or Ipad.
- Never send to iTunes any of your dilemma. They will always answer you that is a Flash error, not a iOs error. And they are quite right. For any other errors, please comment!