RIA Developer, Flex / Flash, Widgets
Widget development on the Flash Platform
An interesting conversation has been happening for a while over on flexcoders. The conversation started with a simple question… Whether or not using the Flex framework is a good idea when developing widgets.
First a little background about me.
A little while back, I worked for a small startup named Snapvine. Snapvine currently has many widget offerings, one of which still gets loaded millions of times each week. These widgets are deployed across hundreds of social networks (who knew there were so many). As the lone flash developer in the company, it was my job was to create and maintain all of these widgets.
The great thing about Snapvine was that I was surrounded by brilliant people, we discussed the Flex framework in extraordinary detail, weighing the pros and cons of using such a framework in our widgets.
So that brings me to the whole point of this blog post… pros and cons for building widgets for the Adobe Flash Platform using Flex.
[Sidenote]
My experience in widget development was mostly focused on development for social networks, so I might say some things that may not apply to other types of widget development.
[/Sidenote]
– Pros –
Flex does a lot of the work for you
Flex does so much of the heavy lifting for us. If you’re ever bored, skim through the Flex documentation. It’s not uncommon for me to find things within the framework I didn’t know existed.
Also, If you haven’t already done so, I highly recommend picking up the O’Reilly Flex 3 Cookbook, or thumbing through it at your local bookstore. I’ve found some really great things in there that I didn’t know about the Flex Framework.
Flex allows quicker development time because there is less code YOU have to write.
Once again, Thanks Adobe… for doing my work for me.
RSLs decrease frequent loading time
The use of Adobe’s Runtime Shared Library significantly reduces multiple loads of your widget. This is because parts of the Flex Framework become cached inside the Flash Player itself. One of the big benefits of the framework RSLs is that not only your widget benefit from them. The framework is cached the first time ANY Flex content, on any site, using framework RSLs is loaded.
One caveat to Runtime Shared Libraries is that you have to configure your widget to utilize them during compilation. They don’t just get used magically. This also means that when you deploy the widget on your web server, you need to also upload and distribute the RSLs.
So if a user visits Picnik, which uses the Flex framework RSLs. Then the user visits a myspace profile page with your widget on it, they wouldn’t download the framework RSLs again (if you and picnik.com are using the same version of the SDK).
Myspace wants users to use Flash Player 9 and above
A while back Adobe and MySpace scratched each other’s back a little bit. Adobe added support for MySpace to disallow navigation events from flash widgets (allowNetworking=”internal”), and MySpace in turn highly recommend users to upgrade to Flash Player 9 (I’m pretty sure they also did this for the video support in Flash Player 9). Myspace did this by prompting users to update their Flash Player if they detected version 8 and below.
That’s a BIG pro for us widget developers, because that means the majority of our widget market is using a player with loads of the features we know and love. At the time of this writing, I’m unsure if MySpace is pushing Flash Player 10, I haven’t noticed it yet.
[Rant]
I’m currently writing this post aboard an airplane at 33,000 feet. Would the person who keeps passing gas, please knock it off, this is an enclosed air system for heaven’s sake.
[/Rant]
– Cons –
Flex is huge, comparatively
300 KB is still too big for dial-up. Many people argue that if people are using MySpace on dial-up, that they’re used to slow loading times. It’s not uncommon for a MySpace profile to be littered with hundreds of 100 KB photos, music, etc… However, that brings me to one of my main points.
By keeping your widget small, It’s more than likely going to load prior to other things on the profile. This is key for getting your brand out there. In Snapvine’s case, this meant that before pictures of friends, before the music players, before the slideshows… Snapvine’s logo was spinning on the page.
Bandwidth is expensive
If your goal if for your widget to go viral, bandwidth is something you should consider. It is bandwidth which drives how much money you are going to spend.
This calculator estimates how much it would cost if you were hosting your widget on Amazon S3 (US).
If you want a direct link… Widget Bandwidth Calculator
If you are curious, you can view the source.
Why is this a con? Using the Flex framework bloats a swf’s file size, and ultimately costs you more money, even if you are using Runtime Shared Libraries.

A simple application which is JUST a combo box, is still 56 KB, even when using Runtime Shared Libraries.
Flex was built primarily for Enterprise Development
This means that lots of the components within the framework, are pretty much useless within widgets. For example, using a datagrid to show massive amounts of data… not really a good use for a widget.
Remember, we’re talking about widgets, not about widgapplications (my spellcheck doesn’t like that word). Most widgets are fairly simple apps. Examples – a music player, slideshow, awesome video slideshow, small game, etc…
Keep your widget fairly simple, if it begins to become too complex, you should probably ask yourself, “Should I be building a 3rd party application (OpenSocial or FBML) instead of a widget?”
It’s hard to selectively use pieces of Flex
I’m not going to say that it is impossible, but loads of classes in the Flex framework are dependent upon each other. Which means that if you’re going to use one Flex class within your widget, it will import ALL of it’s dependencies, whether you use them or not.
– Nate’s opinion –
If I’m building a widget whose soul purpose is to go viral and be loaded millions of times a day, I’m going to write it in straight ActionScript.
Sure, it will take a bit more time, but in the end I’ll save money, have more granular control over my widget, and feel good about myself.
| Print article | This entry was posted by Nate Beck on January 2, 2009 at 1:20 am, and is filed under Flex, Widgets. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
Tip of the Day – Updating to Flash Builder 4.0.1
about 3 weeks ago - 3 comments
I recently posted about Building AIR 2 applications with Flash Builder 4. There is now an update for Flash Builder 4 which downloads and installs the Adobe Flex 4.1 SDK. According to Renaun Erickson’s post, Flex 4.1 includes Flash Player 10.1 and AIR 2.0. Now, if you’re like me and loathe the Adobe Updater… then
Tip of the Day – Building AIR 2 applications with Flash Builder 4
about 1 month ago - 10 comments
:: Update :: This process has gotten much easier, you can now use software update to get AIR 2 as well as Flash Player 10.1 in Flash Builder… check out this post. Adobe AIR 2 and Flash Player 10.1 were released on June 10th, 2010. It’s an exciting time. This weekend I decided to do
Speaking at 360|Flex San Jose 2010
about 6 months ago - No comments
So if you haven’t seen my fun badge there on the right side of my blog… —> I will be speaking at 360|Flex San Jose. If you haven’t attended a 360|Flex conference before, you really should. In my opinion, 360|Flex is the best conference out there for Flex developers. It’s put on by developers for
Developing games with PushButton Engine – Part 1 – Using Flex and Flash Builder
about 9 months ago - 2 comments
So I know I haven’t posted in quite some time. Between work, BugQuash, MAX, contributing to PushButton Engine, my country’s 500th anniversary to plan, my wedding to arrange, my wife to murder and Guilder to frame for it, I’ve been swamped. But tonight… I break my blog silence. As I just mentioned, I’ve been contributing
Getting Dirty with the Flex SDK – Slides and Recording
about 1 year ago - 5 comments
I’d like to thank everyone who attended my TechWed presentation yesterday. We had around 85 people in attendance! Thanks to Stacy Sison for convincing me that I should present. I will be giving this presentation again tonight at the Seattle Flex User Group, so if you are in Seattle… show up. We’ll have a bit
The Flash Builder 4 and Flash Catalyst Betas Are Out!!
about 1 year ago - No comments
So I was going to write a great long blog post about how the Flash Catalyst and Flash Builder 4 betas are out… and resources you can use get started… But Ryan Stewart and Serge Jespers have both written amazing posts already. So all of you should do as I’m doing, and go download the
Tip of the Day – How to create a prompt field on your mx:ComboBox
about 1 year ago - 2 comments
For a long time I’ve been doing things like this within Flex. [Bindable] private var _skills:Array = [ {label: "—", id: -1}, {label: "1 – Newbie", id: 1}, {label: "2 – Some Experience", id: 2}, {label: "3 – Expert", id: 3}, {label: "4 – I’m a baller", id: 4} ]; And then binding this data
Explaining my Adobeholism
about 1 year ago - 6 comments
So earlier today someone sent me an email asking me why I claim to be an Adobeholic. I figured it was an interesting question, so here is your answer… and yes, I’ll admit I’m a fan-boy. My Dock Let’s start off with my dock on my laptop: I’m well aware that this isn’t every piece
Tip of the Day – Flex Coding Conventions
about 1 year ago - 1 comment
Today’s tip is a short one… I have begun planning a very exciting Flex-centric event that is going to be held up here in Seattle. More on that later though. Your tip for the day… The Flex SDK team has a guide that explains the coding conventions that they use within the SDK (for the
Tip of the Day – Understanding the Flex bug system (JIRA)
about 1 year ago - 1 comment
Today a bug that I have been watching was resolved as ‘Not a Bug’. In the QA team’s defense, the original bug description was not very clear. I have commented on the bug explaining why it needed to be reopened. This situation brings up a valid question. How do we (the Flex community) effectively help
about 1 year ago
Use Flex because MXML can be checked into your favorite revision control system!
about 1 year ago
Yea…. so can ActionScript. I’m talking about creating ActionScript only projects compiled using MXMLC. I do agree, however, that checking in an FLA file to version control is not a good way to go… I don’t love it.
about 1 year ago
I meant MXML or Actionscript vs. binaries created with flash. I didn’t read the whole post well enough to realize that your main concern was saving bandwidth. I’m surprised that MXML doesn’t compile down to a swf that is only marginally bigger than AS. What amount of infrastructure (for using datagrids for instance) is carried along with every Flex-built SWF vs handcrafted AS?
I’d guess the biggest headache is that all the different versions of Flash in the wild mean that RSLs aren’t getting the “sharing” hoped for. How persistent are the cached RSLs? Are they cleared as often as cookies? Do they have an expiry like HTTP? Do point versions and flash auto-upgrades wipe them out, making long-term caching unreliable?
about 11 months ago
Good observations and points regarding widget development . We have dojo widgets and I was researching on advantages of using flex. Btwn why did snapvine choose to go with Gigya ? Considering snapvine allows users to create widgets wouldnt it be more appropriate to eliminate gigya or clearspring for viral distribution .. I am sure Gigya might be charging good amount.