Apple blocks Adobe Flash CS5 iPhone Exporter

No Flash for Apple iPhone Fresh off the heels of the release of Flash Builder 4, Apple has announced it will be blocking any attempts by Adobe to create iPhone applications via a Flash CS5 iPhone compiler. Apple made this change following its iPhone 4 preview media event.

The new language in the iPhone SDK:

Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

In other words, one the shiniest, most powerful, most interesting new features of Flash CS5, namely the Packager for iPhone is dead exactly 4 days before the release of Adobe CS5. Adobe has acknowledged the issue.

Despite my previous article critical of Flash Builder 4, I am quite disappointed by this news. Since Flash has been banned from Apple portable devices since their inception, this could have been an excellent way to bring tens of thousands of applications to these devices without any of the risks Steve Jobs (pictured here) has publically chastised Flash for. It seems a like win-win compromise for everyone; Adobe gets Flash applications on the iPhone, and iPhone keeps free of any Adobe-made plug-ins since technically Apple is providing the run-time environment.

I would like to say the two companies will work it out, but the timing of the SDK change seems pointedly directed at Adobe. I guess it is safe to say Apple still holds a grudge.

Update Over the last few days there’s been numerous public fighting between the two companies. Now, sources close to the issue claim Adobe will file a suit against Apple. While I disagree with what Apple is doing, I agree with their ability to block Flash from their devices.

What a lot of Adobe fanatics tend to forget is that Flash is a proprietary platform, not an open web standard. It would be like a developer creating a specialized web plug-in and then demanding it be supported on a cell phone without the ability to modify/change the plug-in. In short, I’d only be on Adobe’s side if they made Flash an open standard that anyone can develop on. It’s ironic that Adobe is claiming foul on Apple’s proprietary platform when they make the only Flash/Flex compilers in the world (the only one anyone uses, to be precise).

cropping video fast for dummies

I wanted to edit a three minute video down to less than 15 seconds.  I’ve never done this before and don’t have any special software.  And I needed to do it in an hour.  What to do?  What to do?

Why the urgency?

I was giving an Ignite style presentation on Stuy Pulse’s journey this season (FIRST Robotics team #694).  Since Ignite slides are 15 seconds in length, I originally decided to go with a static picture.  The night before my presentation, an alum of the team sent out a really good 3 minute video.  I thought it would make my presentation much better to include one 15 second “slide” of video.

Where I started

The original video is 3 minutes and 36 seconds.  I decided it would be nice to show kicking a goal in autonomous (no humans involved), driving over the bump/ramp and hanging.

How I did it

  1. Note that I have Windows Movie Maker on my machine which I can use for basic editing.  The shortcut disappeared, but I can create a new one pointing to C:\Program Files\Movie Maker\moviemk.exe.
  2. Download the video using ClipNabber so I would have a copy of it locally.  This downloaded the clip as an .mp4 file.
  3. Since Windows media player doesn’t support .mp4 files, I needed to convert it to another format.  I downloaded the free QuickMedia converter which was a 45 MB file.  Thanks to the Microsoft forum for the idea.  Converting the file from .mp4 to .wmv took 2 minutes.
  4. In Windows Movie Maker, import the .wmv file.
  5. Play the video using the navigation icons to split the video into pieces.  The relevant buttons were:
    1. Play – to start it
    2. Split – to create a clip boundary (start of end the clip)
    3. Previous/Next frame for precision
  6. Drag the three completed clips to the storyboard
  7. File > Save movie file

How did it work?

This process was good for some rough editing.  I met my goal of having a clip under 15 seconds showing these three things.  For “real” editing, you’d want a better product of course.

The final product

The completed video does show what I wanted.  I didn’t edit out the sound because I knew the speakers would be off during my presentation.  The words that went with that slide were:

red al-liance! ,<clap><clap>, <clap><clap><clap>

blue al-liance! ,<clap><clap>, <clap><clap><clap>

hang! hang! hang!

if 694 wins this, we go to nationals!

<pause>

Then the next slide is a screenshot of the congratulations message; the one at the beginning of this post.

And yes, I got permission from the video creator to do this and blog about it.

Review of Flex/Flash Builder 4 – Defective By Design?

Adobe has released its new version of the Flex Builder, now renamed Flash Builder 4. This version is radically different from previous versions of Flex, introducing the new Spark architecture and theme support. While I’m pleased Adobe has finally added support for Eclipse 3.5, I’m disappointed with some of the new architecture changes that make doing simple things, such as skinning a button, now quite cumbersome.

1. Spark and Halo: Duplicate Code will be Flex’s downfall

The Spark framework introduces a new set of UI components that sit on top of mx, and in many cases, duplicate the logic. For example, you can now define an old Halo button <mx:button/> alongside a new Spark button <s:button/>, both within the same component. I predict this duplication of code will lead to confusing and muddled codebases. Some developers will use all Spark components, some will use all Halo components, and some will use an inconsistent mix of the two.

The idea of two different components with the same name existing within the same application worries me greatly. It would be like Sun releasing a new version of the String class in Java 8, and rather than updating the old String class you now had 2 distinct classes to choose from, both called String, with the package name determining which you use. Sometimes reinventing the wheel is a sign the developers were too lazy to merge their changes into the existing wheel.

2. Broken Migration Paths

When I attempted to migrate some of my Flex 3 applications into Flash Builder 4, I received a number of compiler errors. The first thing I needed to do was right click on the project and change the Theme to Halo (Flex 3-based theme), since it defaults to Spark. This fixed many, but not all, of the compiler issues. After fixing the remaining compiler issues by hand, I ran the application only to discover none of my buttons had text on them! I enabled “Use Flash Text Engine in MX components” which fixed some, but not all, of the button text, but there were still dozens, possibly hundreds, of UI issues that caused the application to look awful. Realizing migrating the entire application into a native Flex 4 application would take endless amount of hours, I reviewed the compiler options again and checked the “Use Flex 3 compatibility mode” option, which, again, fixed some, but not all, of all the issues. Even with Flex 3 compatibility mode enabled, the compiler still handled the following components differently than it had in Flex 3: drag/drop pop-up images, recognizing css text-align property on certain components, and adding padding on some components. With the compatibility mode enabled, the number of issues was drastically reduced to a few dozen issues, but this was at the cost of limiting the new features available in Flex 4.

3. Skinning a button: 5 lines of code now take 51 lines of code

Previously, skinning a button was just a matter of defining some images in a CSS file and telling the application to use this style. It was intuitive, quite similar to HTML/CSS so it was easy to pick up, and only took a few lines of code, such as the following:

.myButton{
	skin:Embed(source="/assets/menu.png");
	overSkin:Embed(source="/assets/menu_over.png"); 
	downSkin:Embed(source="/assets/menu_down.png");
}

Flex 4 now makes skinning extremely complicated. In order to accomplish the above example in Flex 4, you would need to define a custom skin class such as in the following example taken from here:

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2010/03/24/using-a-bitmap-image-skin-in-a-spark-button-control-in-flex-4/ -->
<s:SparkSkin name="ImageButtonSkin"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
        minWidth="21" minHeight="21"
        alpha.disabled="0.5">
    <!-- states -->
    <s:states>
        <s:State name="up" />
        <s:State name="over" />
        <s:State name="down" />
        <s:State name="disabled" />
    </s:states>
 
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.Button")]
    </fx:Metadata>
 
    <fx:Script fb:purpose="styling">
        <![CDATA[
            /* Define the skin elements that should not be colorized.
            For button, the graphics are colorized but the label is not. */
            static private const exclusions:Array = ["labelDisplay"];
 
            override public function get colorizeExclusions():Array {
                return exclusions;
            }
 
            override protected function initializationComplete():void {
                useChromeColor = true;
                super.initializationComplete();
            }
        ]]>
    </fx:Script>
 
    <s:BitmapImage source="@Embed('/assets/menu.png')"
            source.over="@Embed('/assets/menu_over.png')"
            source.down="@Embed('/assets/menu_down.png')"
            left="0" right="0" top="0" bottom="0" />
    <!-- layer 8: text -->
    <s:Label id="labelDisplay"
            textAlign="center"
            verticalAlign="middle"
            maxDisplayedLines="1"
            horizontalCenter="0" verticalCenter="1"
            left="10" right="10" top="2" bottom="2" />
 
</s:SparkSkin>

Talk about wasted space! I understand the power the new skin mechanism adds (you can now layer effects), but I personally don’t feel it’s worth it.

The future of Flex

Adobe has touted the power of Flash Builder 4, but as we have all seen in the past sometimes more powerful designs lead to failure. I think Adobe forgot the KISS principle, or perhaps they had one too many designers at the table instead of developers when they were creating the new architecture. While I liked the ease, power, and simple nature of Flex 3, I’m not convinced of the merits of Flash Builder 4 from a developer perspective. It seems like they made our job a lot more difficult and time consuming.

More articles to follow as I delve into the beast that is Flash Builder 4!