Chapter 12. State Pattern

<feature><title>In This Chapter</title> </feature>

The State pattern is a valuable pattern in ActionScript development. It allows an object to change its behavior when its internal state changes. Take a toggle button as an example. The toggle button must maintain two separate states: one for selected and one for unselected. The two states share the same structure, but they have very different functionality. In addition to the visual display being different, they most likely handle a click event differently, too. This is where the State pattern becomes valuable. The State pattern defines a standard methodology for handling ...

Get Advanced ActionScript 3 with Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.