Flash 9 on 64bit Linux in 2 Commands

I’ve heard it so many times… “Flash 9 doesn’t work on 64bit Linux” So when I loaded 64bit Gentoo Linux my new Merom based Intel Core 2 Duo, I really was expecting an adventure. Turns out that it was actually pretty uneventful. It worked first try without any problems and in only 2 commands. Here’s what I did..

First I added the net-www/netscape-flash package to /etc/portage/package.unmask

sudo vi /etc/portage/package.unmask

Then I emerged Flash 9 & the Netscape Plugin Wrapper

Please Mind the Gap; Between Flash Versions

Currently the latest version of Flash 9 for Windows & Mac is 9.0.28.0 and for Linux (currently in beta) it’s 9.0.21.78. Notice that that third digit is different? That’s mostly because Flash 9 for Linux doesn’t yet support full screen. Unless your application is unusable without full screen, then please be nice to us folks on Linux and don’t tell your Flash detection script to require 9.0.28. This is an easy mistake to make. Even we (Adobe) recently did this with the Kuler app. Which currently doesn’t work on Linux due to an evil 28 in the detection script. If you really do need 9.0.28, then the right thing to do would be to tell your detection script to require it for Windows & Mac, and just require 9.0.0 for Linux. Otherwise we end up having to write GreaseMonkey scripts to de-28 offending pages. And nobody wants to join the list of sites which need de-28 grease.

HowTo: Reduce the size of your Flex app

Flex 2 added a neat little feature which allows you to load Runtime Shared Libraries, from other domains. And since the browser caches these libraries in theory we could all point to a central set of Flex 2 Framework RSLs and users of your application would only have to download the RSLs the first time they went to an application which used them. Before I show you how to make this work, lets talk about the caveats… First and most important, THIS IS UNSUPPORTED BY ADOBE. While the Flex team is working on a better, more permanent solution to this problem, this is really a hack and despite the fact that I am using this in my applications, neither I or Adobe warranty or support the use of this in any way. Second, since there is no failover mechanism, until we find a better home for the RSLs, if you choose to point to my hosted RSLs, your application will be at the mercy of my web server. Third, if someone hacks my web server and uploads new cracked malware RSLs, or uses a man-in-the-middle attack to replace the RSLs in flight, then you (and I) have been p0wned. Fourth, I, James Ward, may have included modified Flex framework files which do bad things, like track user behavior/input and report them back to my server. While I promise I have not done this, if you choose to use these RSLs, you are putting your trust in my promise.

So despite the caveats, I still think this hack is sufficient enough for many applications. Flex engineering is really working hard to make this work for everyone. In the mean time what is outlined here may likely help you to dramatically reduce SWF size. Read on to find out how.

Screencast: Watch a Flex app built in 11 minutes

[Update: This screencast has been updated for Flex 3. Read more about it here.]

Many times I am asked “Where do I start learning about Flex?”. Most of the time I point them to flex.org as a starting point. However it is often just easier to see the product in action. So I recorded a screencast of me building a simple Flex app with Flex Builder. Here it is:

http://www.adobe.com/products/flex/media/flexapp/

I hope this is helpful to those of you new to Flex. After you watch the screencast, download Flex Builder and give it a try. If you find yourself saying things like “Wow! Coding is fun again!” or “I had no idea RIA programming was so easy!”, Welcome to Flexland! A few years ago I found myself in Flexland and to me it’s like being in the mountains… Once you are there, you never want to be anywhere else. :)

Flex Widgets from WidgetsLive!

This morning I had the opportunity to present at the WidgetsLive! Conference about Flex and widgets. I showed a few examples using Ely Greenfield’s DisplayShelf component. One example pulled in images from Flickr. Check out the demo and the code. I also was thinking it would be cool to throw some YouTube videos into the DisplayShelf component. After a few minutes I was able to make it work with the exception that I couldn’t get the reflection to not flicker during video playback. I’ll need to get help from Ely to fix that, so for now I’ve disabled the real-time reflector. You can see the demo of the YouTube DisplayShelf widget and get the code. I also quickly turned one of the Display Shelf apps into an desktop widget using Apollo. I hope all the attendees enjoyed the session and for those who weren’t there, enjoy the demos!

Flex Your Oracle Portal

Last week while many of us were gallivanting around Vegas at MAX, Oracle was holding their OpenWorld conference in San Francicso. Unfortunately I wasn’t able to be in two places at once, so I didn’t attend OpenWorld. But I did have the opportunity of building a Flex demo for one of the Oracle keynotes. I really just took a few of our sample applications and portalized them. You can see the end result on Oracle’s Portlet Testing Site. One cool thing to point out is that the portlets are actually remote portlets being served via Oracle’s JPDK. In case you want to play around with these portlets in your own portal, the provider url is: http://www.jamesward.org:8888/flexportlets/providers/flex_portlets

FLASH & FLEX: FREE FOR ALL (even Linux)!

As of yesterday, for the first time EVER, nearly everyone in the world has access to a FREE, ubiquitous application runtime, and a FREE application development toolkit for that runtime! Of course I’m referring to Flash Player 9 and the free Flex 2 SDK. To show people the power of these two technologies I’ve recorded a screen cam of me building a YouTube video player on Linux. Check it out!

Flex 2 Apps on Linux!!!

One of the benefits of working for Adobe is that I get to test new products while they are still in the pre-release state. One night a few weeks ago I was able to install a pre-alpha build of Flash Player 9 on Linux. I couldn’t contain my excitement when I pulled up my first Flex 2 app on my Gentoo laptop. Smiling from ear to ear I ran over to Emmy Huang (who, as usual, was still working at 7pm), and I thanked her. And the next day I also had the chance to thank Mike Melanson, Tinic Uro who are also investing a lot of time making Flash Player 9 on Linux a reality. Many others at Adobe are also working hard to get the public beta out the door. Most Flex 2 apps I have tested are working, but there are still frequent browser crashes and other bugs that the team needs to fit before we can send a beta out the door. But we are close and I can’t wait to watch the very eager Linux community get their hands on Flash Player 9.

Flex Paint – Flex Display Object to PNG

UPDATE - I’ve created a new version of Flex Paint which doesn’t require the server roundtrip.

Flex allows you to easily create beautiful UIs. But what if you want to take a piece of the UI and save it as an image? Well, using Tinic’s AS3 PNG Encoder, Remote Object, and Flash’s BitmapData and ByteArray API it’s very easy. To show how this is done, I created a simple application called Flex Paint.