New video of iPhone apps built with Flash CS5
Now that the Flash/iPad issue has been done to death on this blog, I can now get back to simply talking about Flash. Adrian Ludwig recently released a video showing some of the newer applications that have been created for the iPhone using Flash CS5. The performance is getting better and better. On this one, Adobe, Apple, and developers all benefit.
Lee
Providing alternative videos for iPhone
Let me state up front that this post is not meant to try to start a debate of the topic of Flash video, HTML 5, and the iPhone. I will post my thoughts on HTML 5 video in another post. The objective of this post is simply to show how easily you can provide an iPhone alternative to your Flash video content.
After getting back from Brasil, I started a new personal blog called Essa Porra. In one of the posts I showed a video of some of the beach jiu-jitsu that broke out down there. I used Vimeo to host the video. Now they recently announced a beta HTML 5 player but it doesn’t work for embedded videos so I decided to provide my own iPhone alternative. The actual steps are quite simple.
First you will most likely need to encode a version that will play nice on the iPhone. I used Handbrake to create it by choosing the iPhone/iPod preset. Now you also have to check off the Web optimized option if you want it to progressively stream. The next step is to get a photo from the video to show if the user is coming from the iPhone. It should have some type of icon showing that it is playable. I chose a simple white triangle. You can see the final result on the iPhone below.

Now you need to provide a little bit of JavaScript logic to check for the iPhone browser and change the content of the page. I took the Vimeo embed code and wrapped it in a div with an id of jj. In the JS code I remove the embed code if the user is coming from an iPhone and replace it with the image. The image is hyperlinked directly to the video file I encoded using Handbrake. This will make the video play in the standalone video player on the iPhone.
1 2 3 4 5 6 7 8 9 | <script type="text/javascript" language="javascript"> <!-- if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { document.getElementById("jj").innerHTML = "<a href=\"VIDEO_URL\"><img src=\"/images/jj.jpg\" /></a>"; } --> </script> |
Lee
Flash CS5 iPhone multi-touch
Here is a very quick video showing the new multi-touch APIs in an iPhone application that was created from Flash CS5. The code needed is shown below. Now I’m off to Brasil!
1 2 3 4 5 6 7 | photo.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoom); function onZoom(e:TransformGestureEvent):void { photo.scaleX *= e.scaleX; photo.scaleY *= e.scaleY; } |
Lee
Flash CS5 iPhone FAQ
I’m glad that so many people enjoyed my last tutorial on creating iPhone applications with Flash CS5. As expected I have received hundreds of questions from people about it. This post will aim to answer some of the most frequently asked questions.
DISCLAIMER: All of the information contained in this FAQ is subject to change.
Will I be able to create iPhone applications in Flash Builder?
Yes you will be able to compile applications from Flash Builder at some point. Think of it just like AIR. You could actually compile on the command line as well. You provide a SWF and an application XML file to the compiler and it creates your IPA file.
Why do the applications appear to be larger in file size than regular iPhone applications?
This is because there are Flash libraries included with your application to make all of this work. The goal will be to make this as small as possible though in the future. But you should expect some extra file weight when using Flash.
Are there certain applications that are not appropriate for this workflow?
Absolutely. While we do have hardware acceleration support in this workflow, you would not want to build full-blown 3D game worlds with Flash CS5. A good example is the Star Wars game created by Infared5. A game like that would not be a good candidate for development with Flash.
When will I be able to try this stuff out?
We are planning a public beta of Flash CS5 before the end of the year. I can’t be any more specific as it is not finalized yet. Again this is subject to change.
Will Adobe provide a way to test things like the accelerometer on the desktop?
Yes we are looking at various solutions for testing device features on the desktop. The next version of Device Central allows for testing accelerometer and GPS but it is unclear if that will work for the iPhone workflow.
Why does it take so long to compile?
I wouldn’t begin to speculate about this or about what is actually going on during the compilation process. We will of course aim to make it as fast as possible. But this compiler has a lot of work to do.
How do you use the hardware acceleration features on the iPhone?
We have a new API which is similar to cacheAsBitmap except that it keeps your display object cached on the GPU even when it is scaled, rotated, transformed in 3D, or has its alpha changed. The actual API details are currently being renamed and that is why I am not providing the low level details at this time.
Can I have more low-level details about how this all works?
Mike Chambers has a great slide deck that goes into much more detail than I have. Go and download it and it hopefully will answer your questions.
Does this mean you are no longer trying to get Flash onto the iPhone?
Absolutely not. We are continuing our effort to get the Flash Player on the iPhone. We need support from Apple to make this happen though.
Lee
New tutorial on iPhone development with Flash CS5
| I just finished uploading a new tutorial that gives you a sneak peek of the new iPhone development features that are coming in Flash CS5. In the tutorial I show how to create a simple accelerometer-based animation which I then compile and transfer to my iPhone. Look for more information here on this workflow coming soon. As for when you can play with this, expect a public beta before then end of the year. |
Lee







