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.
I’ve finally nailed down a good way to use a preloader with Flash Player 7 movies that use the v2 component framework.
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. [...]
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.
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 [...]
I discovered two useful undocumented properties of the event object emitted by the Loader class.