Porting an Application to iPhone Using Flash CS5

Porting an Application to iPhone Using Flash CS5

Tutorial Details
  • Difficulty: Intermediate
  • Program: Flash Pro CS5
  • Estimated Completion Time: 1 hour

Last week saw a very significant development in the relationship between Apple and Adobe. Flash is back in the iPhone picture. In this tutorial, I will show you how to convert an exisiting Flash movie to an iPhone application using Flash Professional CS5.


Step 1: Choose a Flash App

The first thing you need to do is select the application that you want to port. In this example we’ll be working with the Digital Clock app we created in another ActiveTuts+ tutorial.


Step 2: Create a new iPhone OS File

Launch Flash CS5 and create a new iPhone OS Document.


Step 3: Landscape

As you can see, the default stage size is 320×480 px, which is the iPhone full screen resolution in portrait mode (this is holding the iPhone vertically).

However, this application is has a Landscape format and it won’t look good if we adapt the interface to Portrait. Your first instinct is probably to rotate the interface 90° and build the app that way. It will work, but it will be very difficult and you will probably end up with neck pain. For this reason Flash CS5 includes a Publish option to make the iPhone application in landscape mode.

Set the stage size to 480×320 px and continue with the next step, we’ll see how to set the app to Landscape mode in step 10.


Step 4: Interface

To port the interface, a simple copy and paste will be enough. Yes, it’s that simple!

However, in most cases you will need to optimize the graphics, which involves size, alignment and the balance between vectors and bitmaps. Since we are using simple graphics, we’ll focus on the alignment and the size of the elements.


Step 5: iPhone Adjustments

The original application size doesn’t match the iPhone size, so the first thing to do is change the background size to fit the stage.

The current size of the clock text will look too small in the iPhone, select it and change the size to 120px.


Step 6: Class File

Copy and paste the class file to the source folder, no changes need to be made to this file.


Step 7: Document Class

Remember to add the class name to the Class field in the Publish section of the Properties panel.


Step 8: Test for Errors

You can now test your movie to see if everything works as intended.


Step 9: iPhone OS Settings

Here comes the part you’re interested in; the iPhone part.

Now you have a perfectly working Flash movie, it’s time to convert it to an iPhone application. Go to the Properties panel, Publish section and press the iPhone OS Settings button.


Step 10: General

You will now enter a window full of settings. These settings are:

  • Output File: The name of the ipa file that will be created, this can be whatever you want.
  • App Name: The name that will be shown in your iPhone below the icon.
  • Version: The current version of the application; you need to edit this on every test for iTunes to update the app succesfully.
  • Aspect Ratio: The view mode of your app.
  • Full Screen: Hides the top info bar (signal, bluetooth, wifi, battery, etc).
  • Auto Orientation: Uses the accelerometer to change the orientation without writing code.
  • Rendering: A very important option, using the gpu for rendering in complex graphics applications will highly increase the performance.
  • Included Files: The files to be included with your app. If you are loading content from an XML, TXT or any other source you should add those files here.

Step 11: Launch Image

Every iPhone application displays an image at launch while loading the essentials to show the app. This image is the Default.png file we included in step 10. It’s recommended to show the same screen that the app will show when fully loaded, but you can use it to show your company logo, loading screen, title screen, or any other useful info.

The image must be 320×480 it doesn’t matter if you’re working in landscape mode.


Step 12: Deployment

For the Deployment tab, you will need to be a member of the iPhone Developer Program and follow the instructions in the Provisioning Portal to get the necesary files to compile your application.


Step 13: Certificates

There are three different kinds of certificates. The first is the Apple Worldwide Developer Certificate (WWDC). This certificate is compiled alongside one of the other two certificates: either a Developer certificate or a Distribution certificate. These are used for testing applications and deploying to the Apple Store, respectively.


Step 14: Provisioning Profile

The Provisioning Profile is basically a file that states which application we’re testing and on which devices can we test it.


Step 15: App ID

An Identifier of your application, each application ID is required to have its own unique namespace that looks something like com.yourcompany.YourApp. This is also generated in the developer program site and included in your provisionig profile.


Step 16: Deployment Type

Select an option depending on the kind of certificate and provisioning profile you’re working with. A Developer Certificate can be used for Quick Publishing and a Distribution Certificate is needed for deployment, using this kind of certificate will create an app ready to be submitted to the app store.


Step 17: Icons

Next is a simple one, the Icons tab.

Three sizes of icons must be used 29x29px, 57x57px (this is the icon shown in the device) and 512x512px. Don’t worry about the round corners, iTunes will automatically generate them.


Step 18: Publish

When you’re done filling the settings press the Publish button, a progress bar will appear showing the remaining time. The time it takes depends on your application and the files included. Also, more time is needed when publishing for deployment.


Step 19: Device Testing

An .ipa file will be created in your source folder, drag it or double-click it to open in iTunes. You will see the icon of your app with the other applications.

Sync your iPhone and get ready to run your new app!


Step 20: Submit App

If you’re done porting your prefered application to iPhone and want to share it with the rest of the world, you can submit it to the App Store. Login at iTunes Connect and follow the guided instructions.


Conclusion

Now you know how easy it is to develop iPhone applications using Flash Pro CS5, start making your own!

I hope you liked this tutorial, thank you for reading!

  • Ben Stanley

    Awesome. I was experimenting with this just the other day.

    Hope to see many more iPhone tuts here on Activetuts+ in the near future…

    Ben

  • ariadng

    Thanks for the nice tutorial. I’m glad that Apple now accept apps built on Flash. Looking forward to build an app :)

  • http://customtouch.de phil

    Thx for this.
    I got another question on iOS development with Flash:
    Will the x and y position change if i select landscape mode ? So that x is y ?

  • http://lucamezzalira.com luca mezzalira

    I’ve a problem when I try to add ipa file on my iDevice.
    In fact it gives an error (“signer is not valid”) do you have any suggestions!?

  • John

    Your not being very clear on which certificate to use since there are three of them,and which ones to use,how to compile them etc…

    Can you be more clear

  • http://jimmyinteractive.com Jimmy

    Nice tutorial. I got to the last step, Submit App. I ran into a problem..Im on a pc the upload tool is for a mac. I have every thing else done and my app’s status is “Waiting For Upload”. Anyone know how to upload on a pc?

  • ed

    woohoo!
    Flash is back! Flash roooooooocks!!!!

    • sabrina

      Hello,

      I’m trying to make a iphone app for school in flash.(iphone os) But when i import the images they are getting ugly…

      Do you maybe know how i can fix this? your image look normal when I import it..

      i don’t get it :(

      Thnx

  • http://labs.dariux.com Dario Gutierrez

    Great!! The p12 file it was my problem, but with your tut is more clearly. Thanks and congratulations. Saludos desde Mexico.

  • Pingback: L'App Store riapre le porte ad Adobe Flash!

  • http://active.tutsplus.com/author/carlos-yanez/ Carlos Yanez
    Author

    Hi John,

    Thanks for your comment, as mentioned in Step 16, you can use the Developer Certificate for quick device testing and the Distribution Certificate when you’re app is ready to go in the App Store.

    The Ad Hoc certificate can be used to distribute your content to other developers / users directly, you can get it from the Apple iPhone developer portal, it will allow you to specify a limited number of devices that the content can be deployed to.

  • http://www.michelkim.fr matchat

    yeahh !! :)
    this is great !!

  • Qaiser

    Thanks for putting this together. I am waiting on my CS5 master collection to arrive so that I can have a one-suite setup for deploying everywhere (everywhere that matters, anyway)…

    Hope to see more tuts here in the near future!

  • Pingback: Porting an Application to iPhone Using Flash CS5 | Activetuts+ | Flash Designers

  • http://www.dimensionbridge.com Dimension Bridge

    Thank you very much for the tutorial. I am currently starting development for the iPhone using Flash and this was helpful.

  • http://www.e11world.com e11world

    helpful indeed!
    the images shown in the tutorial are not showing up though

    • http://snaptin.com Ian Yates
      Staff

      Really? No problems here – let me know if it’s something you come across again :S

  • http://www.thelbc.be Jk_

    I’m learning XCode to develop iPhone apps but I’m aslo an AS3 dev and this tutorial has been really helpful.

    I advice to everybody wanting to learn more about Flash CS5 IOS dev to read this PDF :

    http://download.macromedia.com/pub/labs/packagerforiphone/packagerforiphone_devguide.pdf

    Thanks for this great tutorial Carlos.

    Jk_

  • http://www.jsCampos.com Jose Campos

    Hey guy do I need to pay for the developer membership to apple to get my apps on my iPhone for testing?

  • Just Frustrated

    Not only are the images not showing up but the download isn’t working either.

    Why should this hapen to a small number of people (UK based).

  • http://www.designmonster.at Sascha

    YEAH !!!!!!!!!!!!!!!!!!!

  • http://www.lightlysoft.com Salomon Gill

    As always GREAT instruction Carlos! By the way, do you have an official website? What’s the best way of contacting you for external consulting?

    My email is sal@lightlysoft.com. Please drop a line when you get a chance.

    Thanks again!

  • http://www.carlosyanez.com Also Carlos Yanez

    Hey Carlos, I’m also Carlos Yanez… graphic designer

    people are sending me emails with questions about your tutorials, sadly they have the wrong Carlos.

    do you mind adding your actual website to your profile so people don’t confuse us?

    small world uh? maybe we’re related! (…gotta call my dad now)

  • Unnammed

    I have 3gs Non-jailbreak iphone can i simply sync this application through my itunes and can run it on my iphone?

  • Pingback: Adobe lanza una versión actualizada de su Package para Iphone | Rubén Morato

  • http://www.psycexplorer.com Michael

    Nice tutorial, but I’m not sure about the actionscript part of all this. Don’t you have to make changes to the script – like change “click” to “touch”?

    • http://michaeljameswilliams.com/ Michael Williams

      I’m not sure about all the script, but mouse events do get treated as touch events, automatically.

      • http://www.psycexplorer.com Michael

        No kidding – so the Adobe “packager” converts your actionscript mouse terms to touch terms. That’s cool. I thought I was going to have to learn all kinds of new actionscript commands.

      • http://michaeljameswilliams.com/ Michael Williams

        Yep! It’s great. Check out Mike Chambers’s post on it here.

  • http://www.psycexplorer.com Michael Britt

    Great link Michael. Thanks so much. Very informative.

  • James

    I was sent a link at work today.
    http://itunes.apple.com/au/app/pandabella/id398269983?mt=8

    It looks so much like the Flash game
    http://www.freeworldgroup.com/games8/gameindex/thesirenofyingyang.htm

    But I don’t have an iPad, anyone can find out if he used the packager to convert it!!!

  • James

    Hello Sir I created few apps from your tutorial. Thanks for that.
    I want to start developing game in flash for iphone. I heard somewhere that heavy animation(vector) creating problem in iphone. Inshort its not look smooth in iphone. Is that correct? Please reply me and clear my confusion because I wanted to start my first iphone game asap.

  • Roey

    Hi Guys,

    CS5 asks me for a password for the .p12
    I didn’t see anywhere in the developer center where I can set a certificate password.. any help please?

    Cheers,
    Roey

    • MajdMan

      Hey, For the certificate u can create one using flash. Open it up, click Adobe Air application go to the publish settings (the box u open that says publish) go to the certificate place and click create certificate save it and use it!

  • DuskyDesigns

    Followed this to know how, to actually create it for jailbroken phones, without the signing and paying 100 dollars:

    http://www.instructables.com/id/How-to-use-Adobes-iPhone-Packager-without-an-Appl/

  • yoinks

    Hello Absolutely Everyone

    I can’t find a definitive, trustworthy answer to this one (and a potentially well-paid project rests on it): Using AS3 (either Flash or Air) via the iPhone Packager, can my app grab a still from the device camera AND/OR load an image from the device (probably camera roll) as chosen by The User?

    Cheers

    Sally

  • http://www.emmanuelhonore.fr Manu

    You might be able to do this, just check the documentation : http://download.macromedia.com/pub/labs/packagerforiphone/packagerforiphone_devguide.pdf

  • http://www.delissues.mx Delissues

    Hi there, for some reason I´m not being able to install this or any app created thru this steps, hope you can help me out here.. My device is jailbroken and I can install third party apps just by dragging them into the app tab in iTunes and syncing but for some reason is not working on these ones… it just says install failed :(

    • MajdMan

      hey try to use installous to install the ipa. Download iFUNBOX (no ssh needed) open it. connect ur device, it will detect it, go to the installous category and drag the app in. Open installous and it will be in the downloads category

  • Lucas

    The Launch Image doesn’t appear :(

  • Lucas

    The Flash CS5 with iPhone development toos are not ready for retina display? I’ve done a image with the size of iPhone 4 screen but she became distorted. And the icon (144×144) why not support?

  • Shaurya Maheshwari

    Whenever I try to test the movie it says:
    “Application descriptor file cannot be parsed”
    what does that mean and how do i solve it???

    • Andy

      Hi, did you solve this? I also have the error of ‘Application Descriptor File cannot be parsed’

  • Michael Voigt

    What is the size of your ipa file?

    what is the size of your .zipped app file?

    basically, what is the minimum app size with the flash engine? This app would be a great example because it is very small and simple.

    thank you!

  • Pingback: Flash solution for iPad and iPhone? - NamePros.com

  • MajdMan

    Dude you are AWESOME! I searched up all tutorials, i did everything and tried everything to get rid of that black screen at the starting up of the app! I’ve made a successful app now! THANKS ALOT

  • Eddie

    Hi,

    I’m new to using FLASH. Ok my problem is when I open up FLASH CS5 I don’t see anything referencing the iPhone OS. Can anybody please help me?

    Thanks in advance

    • http://michaeljameswilliams.com/ Michael James Williams

      CS5 or CS5.5?

      • Eddie

        CS5.5

      • http://michaeljameswilliams.com/ Michael James Williams

        Does this help?

      • Eddie

        Yes thanks.

  • Pingback: Deciding on a Program

  • Antonio IG

    Hi Carlos, I’m a beginner on IOS development and As3, and I have two little questions that maybe will sound absurd, but honestly I don’t get it:

    1.- step 6, you say something about a class file, which one are you talking about? I mean, where is it? or which one you mean at?, and you say something about a source folder, that’s the same where mi .fla and .swf files?

    2.- on Step 7, you say that there is a class field that needs a class name, in the publish section, i don’t know where is the class name, I mean, which one?

    I’m sorry for those questions, I’m learning about as3 and iOS dev. and there is so much that I don’t understand because I’m doing this by myself and my native language is spanish.

    thanks for the tutorial!!

    • Antonio IG

      Ohhhh now I get it, you use an external AS file, but well, now my question is:

      for an iOS app, an external AS file is needed? or you only do it inside the same .fla file, then publish it?

      and, are there some benefits from writing an AS file better than doing inside the same .fla?

      • http://michaeljameswilliams.com/ Michael James Williams

        Hey Antonio,

        This is an old post, so things might have changed, but I believe you could put all your code inside a single FLA if you really wanted to.

        Class-based coding is generally a lot neater and easier to maintain, though, so we encourage it at Activetuts+. Take a look at this Quick Tip for a beginner’s guide.

        Whichever method you choose, you’ll still end up with the same set of files once you’ve published the project.

  • Andrew

    Hello Everyone !
    First of all, great tut man !! thanks !

    But, I’m trying to do the same but for iPad, so I change the resolution to 1024*768 but when I publush the ipa file is in iPhone resolution.
    So how can I change the resolution to fit in an Ipad ?
    Thanks !!!

    Andrew.

  • Pingback: quick start to first iOS app « v: drive