The Library


The library is a repository for all your art and sound. All the raw materials that you need to create games are stored and organized in the library, and you'll quickly become familiar with its use. Use the Window pull-down menu and select Library to open the library panel. This new panel, shown in Figure 1.7, has a list of all the symbols in your movie along with an icon showing you their type. You should see the ball movie clip as the only element in the library.


Figure 1.7: The library is a storehouse for all your Flash assets, including art, sound, movie clips, buttons , animations, and the like.

Click on the ball symbol and drag it onto the stage. This creates an instance of the ball movie clip. It's important to note that the ball we edited was a template for all possible balls instances in our movie. If we were to edit the ball symbol again and, say, change the color from black to red, the ball instance on our stage would change color as well because it is only an instance of the ball symbol that exists in our library.

Go back to the Tools panel and select the black arrow in the upper-left corner. This is the Arrow tool, and it is labeled in Figure 1.4.

The Arrow tool is used to select and move stage elements around. With the Arrow tool selected, you can move your mouse over the ball on the stage. You should see the mouse pointer change to an arrow with a small four-way arrow next to it, as in Figure 1.8.


Figure 1.8: The mouse pointer changes when you are ready to drag an object on the stage.
Tip  

You can create folders in your library to help organize your symbols. Click the folder icon, shown in Figure 1.7, in the lower-left corner of the library to create a new folder. After giving the folder a name, you can drag and drop library elements into and out of the folder. If you click on the icon to the left of the folder's name , you can open and close the list of symbols within that folder. This allows you to more easily navigate through a long list of available symbols.

Caution  

Be careful when you are placing movie clips on the stage. The actual stage is only the part with the white background. The gray area surrounding it is out-of-bounds; movie clips placed there will probably not appear in your final movie.

The change in the mouse pointer is telling you that if you drag the object below your mouse, it will move. Try dragging the ball around the stage a bit.

Now drag two more instances of the ball from your library onto the stage and position them anywhere you want to on the white background. Put your mouse over one of them, right-click, and select Edit from the pop-up menu. This allows you to edit the ball movie clip again. Look back at the Tools panel and select the Paint Bucket icon. It's about halfway down on the right side of the Tools panel, and it's been labeled in Figure 1.4.

Further down the Tools panel, you should see two color selectors called Stroke and Fill color. These icons are also labeled in Figure 1.4.

Click on the lower icon, which is used to change the color of filled areas. You should now see a color selection palette with several different colors to choose from. Pick a reddish color and then click on your ball. You should see the ball's interior become red.

Now select Scene 1 from the top of the stage to go back to your main movie. Notice that all the balls are now red. That's because when you right-clicked and edited the ball, it actually opened the ball movie clip from the library for editing. Because all the balls on your stage are created from the same symbol, when you changed that symbol's color, all the balls changed to match.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net