O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.3. How Do You Create it?

You create an application-specific FrontController by extending the com.adobe.cairngorm.control.FrontController class. The application-specific FrontController is the class that you will use to register the event and command classes for the application you are currently building.

The location of the FrontController will vary depending on what example you are looking at.

For instance, the FStop application example from the "Flex 3: Introducing Cairngorm" article creates it in the business package, as shown in (Figure 5-1).

Figure 5.1. Figure 5-1

However, the Cairngorm store example creates it in the control package, as shown in (Figure 5-2).

Figure 5.2. Figure 5-2

For the purposes of creating an example FrontController, we'll use the business package.

To create a FrontController class, start as you would in creating any new class, but stop when the New ActionScript Class dialog box appears. Again, many developers will create the FrontController class by prefixing the word controller with the name of the application or some other descriptive label, as shown in (Figure 5-3).

Figure 5.3. Figure 5-3

To set the superclass to the com.adobe.cairngorm.control.FrontController ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required