ActionScript ColdFusion

Generate project files automatically

Chris Kief of Rise Interactive released a Flash Project file generator that automatically creates something like the class browser. It requires ColdFusion 6+ to parse directories.

Get it from here.


Not getting what you want?

What do you wish there was in Flash MX 2004?

Here are a few of mine (for ActionScript):

  • abstract
  • final
  • private (a real one that is)
  • protected (switch with the current private)
  • Runtime type-checking
  • True ActionScript 2.0 bytecode for Flash Player 7+
  • A better way to distribute code library without source

If there is something you wish to see in a Macromedia product, let them know by filling the wish form. Apparently they read every message (that’s what I was told), and it may well be true because from past experiences, they have implemented almost every item on my wish list! So, go ahead and offer suggestions to improve the products you use.

Design Patterns

Design Patterns in Flash

As Flash developers, sometimes it is counter-productive by simply copying patterns from other languages or environments. Identifying unique Flash patterns is probably more important, because Flash is unique in many ways.

When talking about patterns, the purpose is to identify common problems and provide named solutions for them, so that developers can communicate easily without coming up with different explanations.

Patterns can be in code, or it can be in other forms. For example, here’s one I use for many different applications, which I call an Event Mask:

Problem: When a custom-made dialog box pops up, mouse and keyboard events must not be passed to underlying objects.

Solution: Create a movieclip (either during authoring time or dynamically at runtime), assign mouse and keyboard event handlers to it, turn off its hand cursor, and display it under/with the dialog box.

This is a very simple pattern that I use all the time. It is unique to Flash because of the way movieclips and events work. Luckily, this is now handled automatically in Flash MX 2004 (such as the Alert component).

A common architectural framework (although some refer to it as pattern) is MVC. One of its benefits is to separate the logic from the user interface; however, many Flash developers find that it is overkill in Flash, again, because of the way Flash work. For example, the timeline, movieclips, and UI components already represent most of the view and controller. Breaking the code up further into three classes may complicate the development process. However, the same may not hold true on a different scale in client-server applications. By keeping the three classes separate, different views can be created more easily (e.g. Flash, HTML for desktop browsers, HTML for handheld devices, XML, WAP, PDF…etc.)

What are your most used patterns in Flash development? Have you identified any pattern that you use on a regular basis, but there is no name for it?


Cross domain policy file

These two important documents provide better understanding of the new Flash Player 7 security changes, and what to do about it:

Security Changes in Macromedia Flash Player 7

External data not accessible outside a Macromedia Flash movie’s domain


MX Developer’s Journal

Here’s a new magazine for Macromedia MX developers from Sys-Con:

MX Developer’s Journal

They are offering a free download of the premiere issue.


Updated Flash player for Sony Clie UX50

The new Sony Clie PEG-UX50 has an updated version ( of the Flash Player 5 that supports networking.

According to the Sony site (via Bill Perry), the following models are supporting Flash:

Player version PEG-UX50, PEG-UX40.

Player version PEG-NX60, PEG-NX70V, PEG-NX73, PEG-NX80, PEG-NZ90, PEG-TG50.

I had three generations of Palm Pilots before getting the 1st generation Pocket PC. Now I’m using a third Pocket PC (Dell Axim running Flash Player 6). It’s interesting to see how far the Palm OS has changed, especially in this new Sony model, because it actually is making a come back.

By the way, check out Bill’s article (among other device-related info) at the Macromedia DevNet for devices.

Tips & Tricks

Class browser

In Flash MX 2004, one thing I wished it had is a class browser. But with all the new features in this release, we can’t have everything on our wishlist all at once, can we?

Here’s a little tip on how to make your own “class browser” with the Project panel:

Because all the classes have external .as class definitions inside the folder:
[Flash installation folder]enFirst RunClasses, we can add these to the Project panel and browse the classes from there. Double-clicking on an .as file from this list opens up the class definition in the Script window (in the Pro version only):


To save you all the work of browsing through the folders and making your own project, download it here: ClassBrowser.flp


Get Flash MX 2004!

After all the excitement since the annoucement, Flash MX 2004 and Studio MX 2004 are available for download (fully functional 30-day trials) and purchase!

Also available are Flash Player 7 and Flash Remoting Components for Flash MX 2004.

ActionScript OOP

Inheritance in ActionScript 2.0

Back in the good old days of Flash 5 and MX, trying to do inheritance in ActionScript required some knowledge of what goes on behind the scene. Also, the infamous superclass invocation bug haunted developers for almost three years.

Now in ActionScript 2.0, with the new OOP-specific keywords, inheritance is much simpler:

class Parent {


class Child extends Parent {


That’s all. And the keyword “super()” in the Child class constructor is not even mandatory because the compiler inserts it for you!

As for the superclass invocation bug, it is now fix for Flash player 7!


Code hints

In Flash MX 2004, some of the component code hints are not listed in AsCodeHints.xml or UIComponents.xml. As a result, what used to be a common thing to do in MX by using code hints such as _cb for ComboBox, does not work now.

Well, there are two solutions:

1) Add you own code hints information to the two files mentioned above.

2) Reference the component class in your code:

var sp:mx.containers.ScrollPane;

Now when you type sp. the list of ScrollPane methods and property is displayed!

Thanks go to Rebecca Sun of Macromedia for this tip.