The Flash 7.2 updater includes a new utility class, mx.utils.Delegate. This very useful class is used to redirect event handlers so you can subscribe to one event and have the component call a method by a different name in your class. For example, if you have a save button and a cancel button, the Delegate class makes it easy to call saveClick and cancelClick in your class instead of just a single click method and having to determine which button was clicked.
Many of us already had custom classes that accomplished the same results, often called EventProxy. However, it is worthwhile to replace usage of those classes with Delegate because Delegate has a major advantage: compile time checking.
In most previous iterations of EventProxy, including my own, the proxy was created by specifying the method to call as a string. However, the Delegate asks for the method to be specified as a reference. Therefore the Delegate instantiation involves compile-time checking and can help reduce errors.
For more information on mx.utils.Delgate, read Mike Chamber’s “Proxying Events with the mx.utils.Delegate Class” article on DevNet.
If you don’t already have it, download the free Flash 7.2 updater.
The Flash MX 2004 7.2 updater, code-named Ellipsis, was released today. The update incorporates both new help content and is coordinated with new DevNet articles. Chafic and I were very pleased to be involved with the updater and provided updates to the styles and skinning documentation and Chafic wrote an article for DevNet on skinning.
The doc updates include both a major re-write of the Using Components > Customizing Components chapter and updating the table of supported styles and skins for all components in the component dictionary. Some notable additions are the discussion of customizing animations and a new entry in the Component Dictionary on Rect Border.
One of the nicest additions is five interactive SWFs that are used to demonstrate some areas that are not easy to explain fully in text. For example, there is an interactive swf that shows the over 100 different button state combinations and one that shows the 98 different border property combinations, shown below.
Along with the documentation updates Chafic has a great skinning article on DevNet, Skinning the Flash MX 2004 Components that talks about the skinning architecture and gives examples of different approaches to skinning.
Continue reading ‘Flash MX 2004 7.2 Updater — new Styling and Skinning information’