The WordBubble class is a fairly simple class that pops up a WordBubble that you can use for a variety of things such as a tool tip. I don't know what you properly call classes like this, but Jody Hall calls them Reusable Classes and that works for me. I tend to think of them as code components, but, unlike components, they are much more accessible. Basically, anytime I find myself copying and pasting the same code from one project to another, I think, aha!, this would make a good class. And then, in the future all I have to do is set up a line or two of code in my present project instead of copying and pasting everything over and over. Once you get a few of these classes made, you are well on your way to having your own class library, and should think about setting it up properly. The advantage to setting up your own class library is that when you make additions or changes to a particular class you only have to do it once and every project you use that class in gets the benefit the next time you recompile, or republish, it. If you add additional parameters to the constructor function you will have to change the code in the projects that are affected, but this is far simpler than updating functions and adding in new variables to each project individually. If you don't have your own class library, I urge you to take a few minutes and set one up. It makes life a lot easier.

A Word About Class Packages and Class Libraries

If you are new to Classes, you may be a bit mystified by the Class Package structure. At the top of each Class you will see something like this:
package ca.xty.myUtils

And in the code where you import classes into your project you will have something like this:
import ca.xty.myUtils.WordBubble;

What this is telling you is that the WordBubble.as Class lives in a folder called myUtils. The myUtils folder lives in another folder called xty. The xty folder lives in another folder called ca. This is a conventional way to organize your classes. What you call your folders is up to you, but the objective here is to have a unique class path. People often use their domains since that pretty well guarantees you a unique path. To take full advantage of your library, the Flash IDE can be set up to automatically include your library. First, you need to make another folder to hold all these other folders. I call my folder flashClasses. Where you put the flashClasses folder on your computer doesn't really matter, but mine lives in the main folder where I keep all my flash projects. So, set up the flashClasses folder and then open up Flash. In CS4, go to Edit-> Preferences-> ActionScript. Down near the bottom, click on ActionScript 3.0 Settings. Near the top, you'll see a space labeled Source Path. Click the + sign to add a new path. Now click the folder icon to browse to the flashClasses folder you just made and click OK. When you set up the folder structure for your class library, put it all inside the flashClasses folder. Now Flash will include the flashClasses folder, and make all of it's contents, available to any of your movies with a simple import statement. So, when you use - import ca.xty.myUtils.WordBubble;, the path to the ca folder is assumed. This procedure makes it easy to organize your classes, and find them when you need them.

The alternative to the above procedure is to simply drop the ca folder into the same folder as your .fla, but if you are going to be serious about using Classes, it is worth the initial effort to get things set up properly. Enough housekeeping, let's get going.