So far in this section, we've looked at how to create new content by drawing vector graphics in Flash. You can also import bitmap graphics to be used as a background to your movie, or to be used as pieces in the movie, vector graphics from other published swfs, music files, and video files. For a complete list of the filetypes which can be imported, choose File, Import, Import to Stage and click the Files of Type dropdown. That lists all bitmap, vector and sound formats that may be imported.
To import a bitmap (jpg, png, gif, bmp, etc), choose File, Import, Import to Stage and browse to find the file. Flash will place a copy of the bitmap on stage and in the library. If you want to use the bitmap graphic as is, it must remain in the library even though there is also a copy (or copies) on stage.
If you want to turn the bitmap graphic into a vector graphic (in order to animate it, or just to have it look "vector-ish"), you can do so by selecting the bitmap and choosing Modify, Bitmap, Trace Bitmap. These are the options for converting from bitmap to vector -- they control how precise (and large, filewise) the final image will be. This information is from the Flash help file:
To create a vector graphic that looks most like the original bitmap, enter the following values: Color Threshold: 10, Minimum Area: 1 pixel, Curve Fit: Pixels, Corner Threshold: Many Corners
Once the vector graphic has been created, the bitmap may be deleted from the library.
Sound files are imported by choosing File, Import, Import to Library and browsing for the sound file. You can import wav, mp3 or aif files, among others. wav or aif files are the best option if you have them, since they are uncompressed coming into Flash. You can then select the compression to apply in the Publish Settings of Flash. mp3 files already have some compression applied, which can only be left as is or more applied by Flash (can't "uncompress"). Also, mp3 files may have a pause at the end when looping, which wav/aif files do not.
You can't import an Illustrator file directly into Flash. But you can open it in Illustrator and cut and paste graphics into Flash. Better yet, you can export your file from Illustrator as a swf (either as one swf, one swf with keyframes = Illustrator layers, or multiple swfs where each = one Illustrator layer). Then choose File, Import, Import to Stage in Flash and browse to find the swf file. Most Illustrator content can be copied precisely this way. Sometimes text does not copy correctly though -- better to create the text with the Text Tool in Flash, or even import a bitmap of the text if it must be precisely formatted.
When a swf that was exported from Illustrator is imported to Flash, the shapes come in as grouped objects. To convert them to native Flash shapes (editable with the Flash drawing tools), select the grouped objects and do Modify, Ungroup or Modify, Break Apart (mac:cmd-B, pc: ctrl-B).
It's easy to create a swf from an animated gif. Just choose File, Import, Import to Stage, select the gif, and Flash will import it in keyframes. Resize the stage to be the same size as the gif, publish, and you're done. In the example on the left (sent by a friend), I also added a stop action in the last keyframe and a button to replay, as described on this page. Side note: you can also export a swf to an animated gif, by choosing that option in the Publish Settings before publishing. My daughter used this often to create AIM buddy icons from Flash animations. |
Discussed on this page:
import sound files, bitmap graphics, illustrator files into Flash, convert bitmap to vector graphic, make animated gif into swf
Other Resources
Flashkit
has a large selection of free sound effects that can be listened to, downloaded and used in Flash movies.
Loopsound
is another site offering sound loops for Flash sites. "Royalty free music loops and sound effects for webmasters, game developers and film makers. Download instantly via e-mail. Also, Sound tutorials and html coding for web page background music."
There are hundreds more Flash sound sources on the web -- google 'Flash sound' to find more.