Importing Graphics and Sound


In addition to creating new movie clips from scratch, you can import graphics and sound from outside sources. Flash can import from a wide variety of file formats, allowing you to create art and sound outside Flash and then bring them in with a few mouse clicks.

Our plan is to import a bitmap graphic from the CD to use in our movie. But first we must create a movie clip to import the graphic into. Select New Symbol from the Insert pull-down menu and name the symbol veggie.

Insert the CD into your drive and then use the File pull-down menu to select Import and Import to Stage. Navigate into the CD drive and then into the Chapter 1 folder. Choose the file named veggie.bmp and click OK.

You have now created a new movie clip named veggie and imported a graphic into it. Notice that the veggie.bmp file is now included in your library. The graphic you see on the stage with the gray outline is an instance of the veggie movie clip. Select Scene 1 to stop editing the veggie and return to the main movie stage. Now drag an instance of the veggie movie clip from the library onto the stage.

Make sure to drag an instance of the veggie movie clip from the library to the stage and not an instance of the veggie.bmp graphic. If you drag an instance of a graphic onto the stage, there is no way to control it with script; by placing it inside a movie clip and then dragging the clip onto the stage, you leave yourself the option of using script to affect it later.

In your library, different symbol types have different icons. Figure 1.9 shows each of the symbol types with the respective icons.

click to expand
Figure 1.9: Different symbol types have different icons for easy identification.

To import sound, you would follow a similar procedure, except that you wouldn't need a movie clip to contain the sound. That's because you don't drag sound files onto the stage; instead, they stay in the library and you trigger them with ActionScript.

Tip  

You should be aware that you can also import finished Flash movies into a new movie. If you create a small Flash movie and you want to use it as part of a bigger Flash movie, you can. Simply import it like any other outside element.




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