Another Useful, Reusable AS3 Class, "Expander"

Crafting a MovieClip for "Expander"
Now, you're in the edit mode of a new MovieClip symbol. In the clip's timeline, create two more layers. Now you should have three layers. Name them (from the top down), "actions," "text," and "bg." Next, click the second frame, top layer. Hold the mouse down and drag till you highlight the second frame on all three layers, then let go. With the second frame of all three layers selected, press F6 to add keyframes to all of them at once. Your timeline should now look like this:


Click the second frame of the bg layer, and draw a larger rectangle. You can use whatever colors you want; I chose to keep the same look. This one is going to be the expanded box, of course. You should make it at least five times larger, although there's no exact size or proportions you need to use. Make it whatever size you think you'll need to accomodate a paragraph or two of text. Again, make sure it's aligned with the top left corner. Here's what I drew, using the same stroke and fill settings:


You should have both frames of the bg layer completed now, so go ahead and lock it. Click on the first frame of the text layer. Select the Text tool, and in the properties panel, choose static text. Click the stage to place a new static textbox. In the properties panel, choose a font face, size, color, and boldness. I chose the "Cooper Black" font, black color, with bold, and found that a size of 16 was about right. In the text box, I typed the word "Help," then chose the arrow (selection) tool to center it to my liking. This was the result:


Next, click on the second frame of the text layer. Click the Text tool again. Again, choose static text, and create a larger static text box with a couple of paragraphs of information, whatever you want. I chose to use a bit of "lorem ipsum" text as just kind of a placeholder. It'll do fine for the purposes of this tutorial, I think. I chose the same font face, color, size, etc. So my expanded box on the second frame now looks like this:


Drag an instance of the MovieClip you just created to the stage. With the instance selected, go to the properties panel and type "help" as its instance name. The instance is ready for the Expander class to control it.

