Monthly Archives: April 2007

Flash Player 9 at 84%

Between December 2006 and March 2007, the number of Internet users with Flash Player 9 installed on their machines jumped from 56.4% to 84.0%. Rock on, Adobe! That’s an amazing boost, and definitely a major success.

Experts declare that 80% is the magic number for adoption before most Flash developers are willing to target a new player version. Oddly enough, Flash Player 9 has been available since June 2006, while the primary authoring tool, Flash CS3, has only been available for about a week or two. As designers and developers upgrade from the previous versions, many won’t need to change the settings for new projects to target an older player. They can begin playing with the new language, ActionScript 3, right away.

Now that we’ve hit critical mass, it’s time to start hearing rumors about Flash Player 10. …I kid, I kid. Go have fun with Flash CS3 for a while first. 😉

Breaking News! Flex Goes Open Source.

In a bold move that will be remembered for quite some time, Adobe announced tonight that the Flex SDK is going open source. The released source code will include the Flex framework classes, the mxmlc and compc compilers, the ActionScript debugger, and an assortment of other tools. Like Tamarin, the open source project created from Flash Player’s virtual machine, the Flex SDK will be governed by the Mozilla Public License. The process of going open source will happen over time with several major milestones in the coming year.

To begin, Adobe intends to open their bug database for Flex to the public in June of this year. Anyone will be able to find and file bugs against the Flex framework, and anyone can start contributing code to improve the upcoming Flex 3. You won’t need to be an Adobe employee for your code to be used by millions of developers. If you take a look inside the current release of the Flex SDK, you’ll notice that the source code to the framework ActionScript classes are already available, though under more restrictive licensing, so everyone can take the first step to submit code related to their favorite features as soon as the database is opened.

In time (probably around December), the complete source code will be available via a Subversion repository so that everyone can check out the latest changes and enhancements. This will include nightly builds and other fun goodies. It appears that they intend to place the project on SourceForge, but that may be a parallel distribution mechanism along with Adobe-controlled servers. During this milestone, the Java source code for the compilers will be opened. The ActionScript compiler in Flex comes from the same codebase as the compiler in Flash CS3. Contributions to this project will more than likely improve not only Flex, but all other Flash Platform developer tools that rely on this compiler.

An announcement like this one requires some additional points to avoid confusion. The open source project for Flex will not include the Flex Builder Eclipse plugin, the Flex Charting components add-on, or Flash Player. As mentioned previously, the Tamarin project includes part of Flash Player already, but some portions of the player, such as media codecs, are licensed by Adobe from third-parties, and Adobe does not own the rights to release that source code. This new project is aimed at the developer tools for Flex. In other words, it contains the core Flex SDK, but not the platform it runs on.

The Effects of an Open Door

Since the Macromedia merger, Adobe has undergone many interesting and awesome changes. Macromedia Labs expanded to include other Adobe products, like the Photoshop CS3 beta. An early alpha of the new Apollo desktop runtime has been released there too. Obviously, I’ve already mentioned the open sourcing of Tamarin. Now we have the landscape surrounding Flex undergoing major and exciting changes.

As someone close to the company mentioned to me today, developers these days look for open tools. They shouldn’t need to pay for a compiler. If they have an editor of choice, they want to easily integrate these core tools with it. They want to be able to improve those platforms that they work with daily, or to fix bugs they discover. In some cases, they want the ability to be revolutionary.

Adobe just made that possible.

Though the SWF specification has been somewhat open for some time, the opening of the Flex compiler will be a major new step that can only be good for the company and the community. We can build SWFs using ActionScript with Adobe tools right now, but in the future what’s to stop anyone from making Java or Python generate SWFs? That main SWF compiler will soon be available to anyone, and I would hope that a compiler expert could go nuts with this sort of thing. Look at Nicolas Cannasse’s haXe as an example of a similar, but still different, language already evolving around the SWF format. This source code will make building something like haXe a bit easier because smart compiler engineers have a reference implementation from which to get started.

In related technologies, the .NET framework allows similar language agnosticity, which brought us Iron Python. Adobe just fired a shot across the bow of Microsoft’s great ship to say “we’re doing that too, but better!” The only way I could see Microsoft beating Adobe with a cool announcement would be to open source the entire Silverlight runtime. Can you imagine? That would be an interesting day, to say the least.

Ultimately, Adobe just gave themselves a world of new competition. Will you need to buy Flash CS3 or Flex Builder anymore? Maybe another company will build better tools around the SDK. I’m excited about Adobe’s confidence and I have a strong feeling that they’ll lead this project well. I hope that any crazy new ideas emerging from the community will push Adobe to experiment more and to continue to build excellent tools to compete with free or otherwise stronger third-party products that may appear on the market after this all happens. Competition is important to innovation, and between this announcement today, and the potential competition coming from Silverlight in the near future, I’m glad Adobe is forging ahead bravely.

I think I’ve said it before, but I can’t help but say it again. Right now is the best time ever to work with Flash and Flex.

Notepad2 support for ActionScript changed

Earlier this month, my favorite ultra-lightweight code editor for Windows, Notepad2 received its first update in nearly three years. Unfortunately, the author made one particular change that I’m not happy about. ActionScript is no longer a supported language. If you’re a Notepad2 user that just so happens to develop with ActionScript, here’s what you need to do to re-enable support for your language of choice.

  1. Click on the View menu and choose Customize Schemes….
  2. Choose the JavaScript type.
  3. In the input that contains js;jse, add ;as to the end. Note the semi-colon.
  4. Open an *.as file to see those delicious colors return!

Since JavaScript and ActionScript are both derivatives of the ECMAScript standard, they can use the same coloring and core syntax information. Hopefully a future release will generalize this setting to ECMAScript and include some more file types beyond JavaScript.

Introducing Silverlight

Silverlight™ is a new form of treatment for WPF/E. Active ingredients include XAML, JavaScript, and HD Video. Do not take Silverlight™ if you are running open source operating systems or if your CPU is slower than 450MHz. Silverlight™ has not completed all clinical trials and should not be used daily. Side effects were similar to Windows Media Player and include vendor lock-in, poor support for non-Windows operating systems, and DRM. Silverlight™ Light Up the Web.

Sorry, I couldn’t help but take a jab. In all seriousness, I’ve actually been meaning to check out this new offering from Microsoft. Perhaps now that its name doesn’t sound like an acronym for a disorder, I might take a few minutes to play around with it.

Unfortunately, it seems Microsoft hasn’t built their Expression products (and certainly not Visual Studio) to run on Mac OSX. It’s kind of hard to take the design world by storm if you don’t offer tools for their primary platform of choice. Oops? For that reason alone, Flash will be king for a long time to come.

Brown's Flex 2 with ActionScript 3.0 an unfortunate disappointment

Looking for a new Flex book to recommend to my readers, I picked up a copy of the Essential Guide to Flex 2 and ActionScript 3 by Charles E. Brown. Until today, I’ve been more than happy with Flash books published by Friends of ED. This book comes in at nearly five hundred pages, but to be honest, I could only read the first hundred and fifty pages before I wanted to stop. Each of the five chapters I read left me wondering if the author wanted to focus on absolute newbie programmers or more experienced developers transitioning from other languages. Even worse, a lot of information was misleading enough to be considered downright wrong.

Chapter 1 starts with an introduction to Rich Internet Applications and ends with the installation of Flex Builder, the ColdFusion Extensions, and Flex Data Services. It’s a general starting point that I would expect from any book about Flex. The second chapter gives the reader the real first look at Flex. This is the point where one must explain a technology to those unfamiliar, and an author needs to properly represent what he or she is teaching. Unfortunately, as the following explanation reveals, Brown leads the reader in the wrong direction from the beginning:

The Flex application framework has its very own tier structure…. At the very top is MXML and ActionScript 3.0. This is quite significant because it means Flex is using the two most popular tools in web design: XHTML and object-oriented programming (OOP).

First of all, MXML isn’t XHTML. I can only hope the author meant XML. However, I wonder if he meant to make a comparison between MXML and HTML so that web designers and developers would have a point of reference. Ultimately, he says that Flex “is using” XHTML, which is true in that an HTML-based webpage will host the SWF, but this has no connection to the MXML at all. Additionally, he mentions that Flex uses object-oriented programming through ActionScript 3. While completely true, the connection between AS3 and OOP has no relationship to the connection between MXML and XHTML. Some might tell me that I’m looking too closely into the details here, but for someone who has never encountered Flex, the initial description needs to be concise and accurate. Consider the following revision that I made. I believe it leaves the reader with a clearer picture of Flex while actually including many of the different interpretations I considered above:

At the very top is MXML and ActionScript 3.0. This is quite significant because it means Flex is using the two most popular tools in web design: the markup format XML and object-oriented programming through ECMAScript, the same standard on which JavaScript is based.

As I mentioned, I had trouble determining the audience at which this book is targeted. Being so large, and brimming with code samples, I would expect a more technical audience. However, the author constantly compares Flex to very design-centric features of Flash Authoring and other Macromedia products, and I imagine a Java or .NET developer would have trouble wading through these types of things.

The early examples and descriptions seem to assume very little programming knowledge on the part of the reader, and Brown explains, in great detail, every new change and addition he makes. He goes as far to tell the reader exactly how the tag structure of XML must work before he writes his first bit of MXML. Very few developers will have no knowledge of XML, and the introduction of such a basic data format seems even stranger when he adds a highlighted block aimed at transitioning developers a page or two later. He says, “If you have ever done Java programming, an analogy can be drawn to the main method.” Let me add, by the way, that this comparison notes that the main Application MXML file is like the main method. While true, in an odd sort of way, comparing the main container, written in a markup language whose purpose is to layout subcomponents within more containers, to the entry-point of a Java application is one of the stranger things I read in this book. At the moment I read it, I was just starting to think (again) that the book’s focus was on designers (who aren’t likely to be writing Java applications).

Ultimately, the book fails from a lack of focus and too much extra content. Several of the first examples detail the same steps (including screenshots) for creating a new Flex project. As mentioned previously, the author explains the most basic concepts, like the structure of XML, while adding pointers for developers who would most likely have gotten bored and skipped the early content anyway. Finally, imprecise comparisons muddy the waters and could probably cause a lot of confusion. I can not recommend Flex 2 with ActionScript 3.0 because I believe Flex should be presented in a very different manner.

10 Great Ways to Learn Flex

After answering a couple beginner questions on a forum today, I decided it would be awesome to have a list containing the best resources for getting started with Adobe Flex. If you’re looking for useful information about building the next generation of RIAs with Flex, I encourage you to use this list as a launch pad because the links it contains should lead you to more and more knowledge throughout the web.

  1. Adobe’s official Flex Quick Starts offer some simple code samples to get you started, and they’re categorized very nicely into the sort of tasks you’ll want to learn right away.

  2. Additionally, Adobe offers free video training with a series called Learn Flex in a Week. If you’re willing to throw down some cash for video training, you might want to see the Flex online training available through Lynda.com. Another premium option is the Flex content available from Total Training. Finally, be sure to take a peek at the Flex category on Adobe TV for content aimed at a wide variety of skill levels.

  3. If you find yourself doing a lot of work with Flex, the Flex Language Reference will be your new best friend. Even as your skills and knowledge increases, you’ll keep coming back to this ultimate guide for Flex and Flash Player’s APIs. Every component property, method, event, and style is at your fingertips, often with useful inline examples. You can access it directly under Flex Builder’s Help menu too, if you prefer.

  4. The flexcoders mailing list is a great place to ask questions if you’re having some particularly difficult problems with Flex. You can also read the flexcoders archives through The Mail Archive for an easier reading and searching experience. Also consider subscribing to the flexcomponents mailing list to learn about building custom components for Flex. You shouldn’t post general Flex questions here because this list is specifically designed for discussion focused on components. Even if you aren’t into building components, I recommend watching the discussions there because many of the list’s experts share useful insights into many hidden aspects of the Flex framework.

  5. The Flex Cookbook is a community-driven site that includes a lot of short and simple how-tos for Flex. The style is much like the ActionScript 3.0 Cookbook. As an exciting bonus, the best contributions to the site will be considered for inclusion in the printed versions of the Flex Cookbook, published by O’Reilly.

  6. Join a local Flex user group or consider starting your own. Typically, Adobe user groups meet once a month and include tutorials and presentations by local experts or special guests from the worldwide community. These guests tend to work with Flex in the trenches for companies large and small. From time to time, you might even get to meet a real Adobe employee who can offer excellent insights into the products they evangelize.

  7. Play around with the sample applications from Adobe’s Flex DevNet. They also come with Flex Builder, and should appear on the Start Page, which you can reopen from the Help menu. The best part of these applications is that you can right-click on them and choose “View Source” to look at the complete source code. Additionally, and perhaps not as well known, you can download the source code for all the ActionScript 3.0 examples that appear in the Flex documentation in one big ZIP file from Adobe’s site too.

  8. We’re starting to see some good stuff for Flex on bookstore shelves. Current and upcoming books that focus on Flex and ActionScript 3.0 include the following (in no particular order):

  9. Consider installing Tour de Flex, an AIR application that includes a plethora of examples for all the Flex components, effects, data access classes, AIR capabilities, and data visualization controls, along with several open source and commercial components built by the community, and even public “cloud” APIs that can be used in Flex-based mashups and other applications.

  10. Finally, there’s Flex.org, the official developer portal for all things Flex. It offers a ton of links to blogs, consultants for hire, and job postings related to Flex. Flex.org is probably most known for its showcase page which highlights some of the best Flex content on the web.

If you’re looking to help get someone started with Flex, or someone asks you what they need to learn to build their first Flex application, please send them here. Remember, anyone you help as they’re struggling as a beginner may be able to help you in return someday in the future when they’re past the early hurdles. The best way to build a strong community is to contribute to it yourself and encourage others to participate too.

If you found this post useful, you might also want to check out my related post, 12 Great Ways to Learn ActionScript 3 in Flash. It includes links to more great content that should benefit Flex developers too.

Giving Cairngorm a Test Drive (Example Code)

As an application’s complexity increases, the ease of maintenance decreases. Heck, sometimes it gets harder to even extend an application with new functionality. I’ve been working on a Flex project in my free time for the last six months or so. It’s been getting pretty unwieldy lately, and I’ve had to juggle a few too many ugly details just to modify certain interactions. After a particularly frustrating night, I decided that I should finally take a break from my coding and check out Cairngorm.

For my first flying leap into this framework, I started by developing a simple search application based on the Yahoo! API Libraries for ActionScript 3. It displays web or image results in a list and allows you to move back or forward between pages. Nothing too complicated. I wanted to start with something a bit more complex than this Hello World example (written by Laura Arguello at ASFusion), but I needed to keep it simple enough that most of my focus would be on learning Cairngorm rather than designing the interface.

I had some trouble finding simple examples of Cairngorm out in the wild, and I found it a bit frustrating. If you’re new to Cairngorm, and you want to learn more, please right-click on the app to view the source code. I encourage you to focus on the MVC structure of the classes. However, please note that I didn’t spend a lot of time cleaning up the code for the user interface. In particular, there’s a messy item renderer on the search results list that I should have made into a proper class, and I’m sure I decided to skip a few other best practices. It should be useful enough, though.