Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As we mentioned previously, everything we’ve shown you so far can also be done through ActionScript. Although MXML allows for rapid, tag-based component development, many feel that creating custom components with ActionScript provides enough control for maximum reusability. By the time you finish this section on creating custom components, you’ll be able to evaluate the options for yourself and decide whether you agree.
Let’s start by creating a state-selector custom component, but this time you’ll be using ActionScript instead of MXML to create it. The ActionScript code for the component is illustrated in the following listing.