Flash 8: Projects for Learning Animation and Interactivity (OReilly Digital Studio)
2.5. Automate Your Workflow
Having to manually repeat common tasks, such as drawing a box, can slow you down. To speed up development, Flash can automate many of your efforts. One simple way for users of all skill levels to automate repetitive tasks is to save steps from the Undo History as Flash macros called commands. To start, you need to understand the History panel. 2.5.1. Making History
The History panel begins as a blank slate and tracks your actions while you are editing your movies. This allows you to undo and redo your actions, step by step. As you'll see, it also allows you to replay single actions and save sequences of actions for later use. To take advantage of these features, you need to make history:
Have you noticed the History panel filling up with information? It tracks each task you perform in order, resulting in something like the history list shown in Figure 2-10. Figure 2-10. The History panel
You've already seen how the Undo command can help you travel back in time, but the History panel allows you to retrace as many steps as you please by stepping through a written list of the tasks you have performed. At any point, you can step backward in the History panel and start again from a previous step, or simply repeat a sequence by choosing the steps to replay. Take a look at how it works:
Instantly, the steps selected in the History panel are replayed, creating a box in the same position as the first one you drew. You now know how to perform a sequence of steps and replay them, but the process of drawing the box needs to be simplified so Flash can replay the sequence faster. In this case, you drew a box and immediately changed its colors. It is easier for Flash to replay the sequence if you choose the colors you want before drawing the box, so it's time to simplify. 2.5.2. Economizing a Sequence
A long list of actions in the History panel, like the one you have now, can be difficult to read, and you need to be able to identify which steps to save as part of the sequence. So, the first step in simplifying the creation of your box is to clean up the History panel:
Figure 2-11. The History panel
Now you can cut the drawing process down to four steps, for an economical sequence that can be saved and quickly replayed by Flash. While you're at it, you can add a step that converts the graphic to a symbol, so Flash will also do that when you replay the sequence. Perform the following steps exactly as they are listed, without any extra clicks or other actions:
Your new, more efficient sequence is easier to read and faster for Flash to execute. Next, you'll see how to save and reuse the sequence. 2.5.3. Commands: Next-Generation Macros
To make a sequence of steps reusable (like the macros common to many other applications), you need to save it as a command, as follows:
Now you have a command that creates a gray box any time you need it. Try starting over to see if it works:
Each time you execute the command, Flash creates a brand-new box and places it in the same position as the box you drew originally. Why? Because the History panel, in addition to tracking steps, tracks the position of the box as you draw it. Also, each time you run the Make a Box command, Flash converts the box to a symbol for you, eliminating the need to repeat the process manually. This is a great time-saver. So why doesn't Flash use the name box_mc every time you run the Make a Box command? If Flash named every new symbol box_mc, there would be no way to distinguish among them without renaming each symbol. The default naming convention used by Flash (Symbol 1, Symbol 2, etc.) keeps each symbol identifiable in the meantime. Just as you saved your own command, you can download and install commands created by others. In Chapter 15, you'll learn more about customizing Flash this way. First, however, you'll concentrate on your first animation. |