Accessibility

Flash Article

 

Flash Professional and Flex 2


Mike Chambers

Mike Chambers

Adobe

Created:
17 October 2005
Modified:
8 May 2006
User Level:
All

Today we released the public alpha of the Macromedia Flex 2 product line and technologies. This article will discuss what we released, how Flex 2 relates to Flash authoring, and how designers and developers can integrate the two to create rich, expressive content targeted at the next generation of Macromedia Flash Player.

As a developer, I have grown up with Flash by my side. Starting with Flash 3 (no real scripting), to slash-syntax in Flash 4 (ugh!), Smart Clips in Flash 5, and finally reusable components and a more robust scripting language in Flash 6 and 7. However, the Flash authoring tool has always been at its heart a creative tool, and trying to shoehorn a development environment into that always seemed to leave developers asking for more (and too often left designers asking for less). However, the expressive capabilities of Flash, as well as the ability to easily deploy applications to just about anywhere, made it worth the awkwardness of developing applications in a tool designed from the ground up as a creative tool.

This is why I am so excited about Flex 2. I can develop for the Flash Platform with an environment and framework designed from the ground up for developers targeting the Flash Platform, while at the same time taking advantage of the creative and expressive capabilities of Flash authoring.

What Is Flex 2?

First, what did we announce? What is the Flex 2 product line?

  • Flash Player 9: Next generation of the Flash Player with a new virtual machine (VM) written from the ground up with performance in mind.
  • ActionScript 3.0: Developed to be 100% ECMA compliant, with performance and developer productivity as top goals.
  • Flex Framework 2: Next generation of Flex Framework, an XML (MXML) and ActionScript-based application development framework.
  • Flex Builder 2: Written from the ground up on top of the open source Eclipse platform. It allows developers to leverage Flex Framework and ActionScript 3.0 to create, compile, and deploy applications (which do not necessarily require the Flex server).
  • Flex Enterprise Services: Next generation of the Flex server, which provides enterprise level data services, as well as other runtime features.
  • Flex Charting Components 2: Robust set of charting components built on top of Flex Framework.

One thing that you have probably already picked up on is that "Flex" now has a much broader meaning than it has had in the past. Where as Flex used to refer to an enterprise level server that allowed developers to create rich and expressive applications (Flex Server 1.5), it now refers to a family of products and technologies (Flex Builder, Flex Framework, Flex Enterprise Services ActionScript 3.0) that enable all developers to create rich, expressive applications that leverage the ubiquity of Flash Player and can be run virtually anywhere.

Just to make sure that this point sinks in:

YOU DO NOT NEED FLEX SERVER TO CREATE APPLICATIONS WITH THE FLEX FRAMEWORK.

You can, of course, create applications with Flex Framework, which take advantage of the many features of Flex server (now called Flex Enterprise Services).

So, basically, you can now use Flex Builder 2 to build applications with ActionScript 3.0 and Flex Framework. Flex Builder can compile those applications (into a SWF file) and you can then deploy those SWF files as you would any other SWF (i.e. just upload it to a server).

Did You Say ActionScript 3.0?

Now, if you are like most Flash developers, the first thing that got your attention was the mention of ActionScript 3.0 (it was the first thing that got my attention). This is the new version of ActionScript in Flash Player 9 (formerly Flash Player 8.5), which takes advantage of the new Virtual Machine (VM) in the player.

Flash was originally developed as an animation tool and plug-in, and over the years evolved to provide more and more programming and developer capabilities (adding support for scripting, developer-focused APIs and more structured scripting syntax). However, at the heart of the player, it was geared toward animation and other expressive content, and not optimized as a development runtime.

After years of optimizing the player for performance, we realized that to take the player to the next level, we would need to rebuild the virtual machine from the ground up, and create a player that was as optimized for code execution as it was for frame and vector rendering. This led us to create the new virtual machine that is in Flash Player 8.5 alpha, and to develop ActionScript 3.0 to run on top of the new VM.

Underneath the hood, ActionScript 3.0 has been completely rewritten along with the player's new VM. This has allowed us to clean up a lot of things, optimize for performance and memory usage, and make a more robust and productive language. However, syntactically, the language has not changed much. Thus, if you are familiar with ActionScript 2, you will immediately be able to understand ActionScript 3.0 code. For example, here is a simple class:

package com.macromedia.foo
{
	import flash.util.trace;
	
	public class MyClass extends MyBaseClass
	{
		public function MyClass()
		{
			sayHello();
		}
		protected function sayHello():Void
		{
			trace("Hello!");
		}
	}
}

What are the benefits for Flash developers from ActionScript 3.0? Here are a couple:

  • Much stricter compile-time checking.
  • Better runtime error handling and reporting.
  • Performance, performance, performance. Fundamental performance increases across the board (as opposed to the targeted performance increases we have had in the past).
  • Lots of new APIs including regular expressions, E4X (ECMA standard XML parsing), and true binary sockets.
  • Much improved debugging environment.

Of course, you can head over to Macromedia Labs right now and download all of the bits and start playing, so I am not going to go into too much more detail on this right now.

What If I Still Want To Use Flash Authoring?

Ok. So I know what some of you are thinking. I just bought Macromedia Flash Professional 8, and love it. The tool is rock solid, I know how to use it, and the new features are great. Can Flex Builder and Flash authoring work together?

Yes! You can use Flash authoring in conjunction with Flex Builder, and play with all of the new stuff today. Since Flex Builder has support for ActionScript-only projects, you can use Flash authoring to create your content, and then bring those assets into your ActionScript project in Flex Builder and compile the application for Flash Player 9. This is a similar workflow that developers are using today when using external editors such as Eclipse, SE|PY or PrimalScript.

For example, let's say you are working on a game that would benefit from the performance increases and productivity improvements of ActionScript 3.0 and Flash Player 9.

You could create all of the assets for the game in Flash 8 Professional. This would include graphics, videos, animations, etc. You could then do all of your programming in ActionScript and Flex Builder 2, and include the Flash assets in the SWF at compile time (ActionScript 3.0 has support for embedding assets and associating them with an ActionScript class).

The end result is a SWF file that contains all of the code and assets for your game, but which takes advantage of ActionScript 3.0 as well as the new Player APIs and virtual machine.

As a bonus, Flex Builder 2 also includes a command-line compiler (Hallelujah!), which will allow you to compile your projects from the command line or from other editors.

Of course, Flash authoring is also going to get full support for ActionScript 3.0 and we are already planning and working on the next full release of Flash authoring (code-named "Blaze"). Since it is so early within the development cycle, we can't say when Blaze will be released (the normal development cycle for Flash Authoring is 18 to 24 months). However, we will be releasing an alpha version of Blaze in the spring of 2006 that will include ActionScript 3.0 support. This will be a pre-release alpha version (not an update to Flash 8), and will be available to anyone who has purchased Flash Professional 8 and or Macromedia Studio 8.

Why Are the Player and Authoring Tool Not in Sync?

Finally, a couple of people have pinged me on IM with concerns that Flash authoring will not have support for the new player and language when the player is released in the spring. I have to admit, that this was also my initial thought when I heard this news. In the past, the Flash authoring tool and the player were closely linked, with both the player and authoring tool following the same development and release cycles.

However, that was when Flash Player and the Flash authoring tool were the only Flash-based technologies from Macromedia. The player has grown into a complete platform, with a vast ecosystem of products and technologies that rely on it (such as Breeze, Flex, Flash authoring, etc.). Because of this, it is impossible to keep all of the technologies in sync. The player will often not be in sync with other products that rely on the platform. Indeed, today Flex developers cannot yet take full advantage of the features in Flash Player 8, and won't be able to until sometime in the spring (when the Flex 2 family of technologies is released).

The same thing will happen with the Flash authoring tool when we release Flash Player 9 in the spring. Flash authoring won't support all of the features of the player until the next full release of the Flash authoring tool (although, as I mentioned above, we will have a public alpha that does).

All of this is just a consequence of the growth and success of the platform. The end result though, is that the player can innovate much faster, and products that rely on the player can then take their time to implement the features in a way that makes sense for their users.

One advantage of this is that by the time we release Blaze, Flash Player 9 will have been out for a very long time. Indeed, it is conceivable that on the day Blaze ships, the player it targets could already have 50–70% adoption (based on historical player adoption rates). That would be a first for Flash, and would ensure that new features could be widely used the day Blaze is available.

When Can I Play with It?

Now that we have talked about how Flash authoring and Flex 2 relate to and complement each other, its time to start playing. Head over to labs.macromedia.com and download Flex Builder and Flash Player 9.

Just remember that everything is an alpha release. This means that there will be some rough edges and some things won't work. We have never released software this early before, but we are confident that the advantages of getting feedback from you early, and you getting to see what we are doing, will far outshine any rough spots.

Resources

We have released a ton of information on Flex 2. Here are some links to get you started:

About the author

Mike Chambers has spent the last eight years building applications that target the Flash runtime. During that time, he has worked with numerous technologies, including Flash, Generator, .NET, Central, Flex, and Ajax. He is currently the Principal Product Manager for developer relations for Adobe AIR. He has written and spoken extensively on Flash and rich Internet application development and is coauthor of the Apollo for Adobe Flex Developers Pocket Guide, Adobe Integrated Runtime (AIR) for JavaScript Developers Pocketguide, Flash Enabled: Flash Design and Development for Devices as well as Generator and Flash Demystified. Mike received his Masters in International Economics and European Studies from the John Hopkins School of Advanced International Studies (SAIS) in 1998. When he is not programming, Mike can be found playing Halo 2, trying to recover from his World of Warcraft addiction, or playing with his two daughters.