Flash on the iPhone

There may be times when it is essential that a Flash animation is available to users on Apple devices such as the iPhone and the iPad. Here is a technique that addresses this requirement using Google’s rather wonderful open source project Swiffy.

Firstly, your Flash movie should be no larger than 1MB and ideally exported for Flash Player 5 although Swiffy supports most of the AS2 specification. For those of you who don’t remember, you can do a great deal with Flash 5 and AS2. Probably a great deal more than Safari on the iPhone will allow us to do.

Under the hood, Swiffy processes the SWF file and generates a JSON file. A client-side JavaScript runtime loads that JSON file and renders it using HTML, SVG and CSS which is supported by Webkit-based browsers such as Safari running on Apple devices.

When you process your swf, Swiffy outputs an html page that you can place on your page using an iFrame. I know, I know an iFrame! However we’re only using our iFrame to serve alternative content to less than 5% of our visitors. There’s nothing for Google to index so it makes very little difference to the end user. I’ve added an alternative version to the header of this page, making the animation, podman cursor follower and all, viewable to iPhone users, for what it’s worth. It’s pretty clunky, probably only making 8 frames a second on my iPhone, but it’s a pretty complex multilayered animation, with lots of bitmaps and transparency. While the animation in the header of this page may not have been designed for WebKit, it could probably be optimised quite easily. A little trial and error goes a long way. Maybe I’ll follow this article up with a sequel.


Fla Exporter

For those looking for a Google Swiffy replacement now that the Swiffy service has been closed, FlaExporter provides a viable alternative.

Here’s why this is important–
1)Google shut down Swiffy on July 1st.

2)Development on Mozilla Shumway seems to have stopped.

3)Fortunately a new tool, FlaExporter, picks up where Swiffy left off. FlaExporter is a new way to publish high-performance HTML5 content directly from your Adobe Flash or Animate files without having to restructure anything. It even has an option to auto-optimize during publish that typically results in files that are 60-80% smaller. Some key features —
* Blazing fast mobile and desktop web performance (60 FPS)
* No .fla restructuring required
* Reduce file sizes 2-10X
* Use advanced features like mask layers, blend modes, and timeline ActionScript

More Info —

Leave a comment