Archive for 'Flash ActionScript'

Using a preloader with v2 components

I’ve finally nailed down a good way to use a preloader with Flash Player 7 movies that use the v2 component framework.

Using a static initializer in AS2.0

Some design patterns require the use of a static initializer, a block of code that should execute once and only once the first time a class is referred to. The typical use for this pattern in ActionScript programming is when a mix-in class needs to be used, as in the case of the mx.events.EventDispatcher class. [...]

Differences between AS2.0 and Java

ActionScript 2.0 is much more object oriented and Java-like than its predecessor, which makes it easy to learn for Java programmers. Here are some key differences, which may help make the transition easier.

Using the event framework outside Components

The v2 component architecture introduced a new event dispatching and handling framework, in which event objects are produced by components and consumed by whatever listeners are attached to them. For more information on this, refer to the Flash documentation under “Using the event object”. The following sample code illustrates the basic principles. listener = new [...]

Useful undocumented properties of the Loader.progress event

I discovered two useful undocumented properties of the event object emitted by the Loader class.