Getting started with Flash development
Written by David Conrad   
Tuesday, 23 November 2010
Article Index
Getting started with Flash development
First Flash program
Going further
Flash or Silverlight?

To many developers familiar with other technologies such as Java, .NET or Javascript, Flash can seem like a trip to a foreign land. In fact it is fairly quick to pick up the language and discover that it is all a lot like what you already know.

You may know HTML  and Javascript, or you may be a Silverlight expert, but Flash application development often seems like a foreign country where they do things very differently. In fact the parallels run deep and once you identify the various jargon for the common technologies it all starts to look much more familiar. So find out how to get started with Flash application development in just a few pages.

Origins of Flash

First you need to know why Flash is so difficult for a developer to get into. Flash started life as a way of creating multimedia content, mainly animation, for web pages. As time went on it acquired a programming language - ActionScript - and an extensive framework - Flex.

Although the name of the programming language makes it sound as if it was a niche language aimed at animation or special effects, ActionScript is a perfectly general-purpose language based on ECMAScript, aka JavaScript. In other words the chances are that you already know ActionScript.

Unfortunately if you try to use it via the standard Flash IDE - Adobe Flash CS4 - then you will have to look fairly hard even to find it. Adobe Flash CS4 is roughly the equivalent of Microsoft Blend and you wouldn't attempt to create a .NET project using Blend - well not anything even slightly complicated. CS4 does have buttons and other components but the most prominent feature of the overall interface is an animation timeline and for most developers this just gets in the way.

The correct place to start is to use FlashBuilder. This is more like Visual Studio and provides an IDE for developers to use to create applications.

Flex is the ActionScript framework that provides all of the components and classes you need to build an application and to demonstrate how important it is FlashBuilder used to be called FlexBuilder until the version 4. FlashBuilder is an IDE that integrates ActionScript and Flex. 

In case you are wondering where "Flash" comes into it at all - this is the "player" that hosts the virtual machine (VM) that runs your application. This is the equivalent of the Silverlight add-on that runs .NET applications in a browser.

Finally there is AIR (Adobe Integrated Runtime) which can be used to run a Flash application on the desktop. You can think of AIR as being similar to the .NET runtime but it came last in the development of things.

Indeed you can see Flash as starting out by using the browser as a way to build animation and special effects and working its way to the desktop and a general purpose programming environment whereas .NET started a general purpose programming environment for the desktop and has worked its way to a browser add-in that can produce animation and special effects.

This is the reason Flash is tough to get into for the developer and .NET is hard to get into for the designer.

There are some other issues however.

Eclipse

Perhaps the biggest hurdle for a .NET programmer in getting to grips with Flash is that FlashBuilder is designed as an Eclipse add-on. There is nothing wrong with Eclipse but it isn't Visual Studio and it has its own sometimes strange ways of doing things. There is also the fact that it is sometimes idiosyncratic and often slow - a feature which causes it to appear even more idiosyncratic.

However if you give it time you can grow to like Eclipse and it has the advantage that it has lots of add-ons for working with languages from Java, through JavaScript to PHP and more.

Despite the fact that Eclipse is free to download and open source, FlashBuilder is a commercial product. You can however download it and use it for 60 days for free and this should give you plenty of time to find out if it is a suitable development environment.

The examples in the rest of this article all use FlashBuilder 4 but using the previous FlexBuilder 3 is very similar if not identical.

You can either download the full standalone version or an Eclipse add-in. Clearly if you have Eclipse already installed then the add-in is a good choice but even in this case the standalone application has the advantage that it "just works" and can be removed in one easy step if you decide that you really don't want to use it.

Hello Flash

As with all new languages and environments, the best way of getting started is to write the simplest possible program - hence "hello world".

If you download and install FlashBuilder 4 it starts off configured ready to create all types of Flash projects.

The simplest option is to create a Flex project - which can contain multiple applications but for the moment we will concentrate on just one.

Create a new Flex Project called Hello World:

new1

Creating a new project

<ASIN:0596159765>

<ASIN:0321579216>



Last Updated ( Tuesday, 23 November 2010 )