Now that you know how to create a class in MooTools, it'll be a piece of cake to use the already-existing classes in the MooTools framework. You've already used a MooTools class, whether you know it or not, with the Options
class that we implemented in the Dogs
class.
Let's look at another class, the Chain
class, so that we can explore how to use MooTools classes. And we're going to hit three birds with one stone here: by covering the Chain
class to see how MooTools classes work in general, you'll also discover a key concept in the MooTools framework—chainability, and be able to witness the power of the Chain
class. Once we're done, it'll be a cinch to use other MooTools classes such as Fx
class for animation effects (we'll cover in greater detail in a later chapter).