May 17, 2011, 2:01 p.m.
posted by daemonhell
As is true with raster graphics, Flash can import vector assets from a variety of external applications, and in a variety of formats. Here, we'll look at how to import Adobe Illustrator, Macromedia FreeHand, and Adobe PDF assets, and even other SWF files.
Importing from Illustrator or FreeHand
Both Illustrator and FreeHand support enhanced importing options, as seen in Figure. Both will allow you to convert drawing layers to Flash layers or keyframes, as well as flatten the drawing into one layer and keyframe of vectors. They also both allow you to optionally import hidden layers and maintain text blocks. Finally, Illustrator allows you to rasterize the entire drawing into a bitmap of almost any resolution. (You will learn more about pages in the section "Importing from PDF.")
Standard vector asset import settings
If you have Illustrator, you can open the tabbed.ai file (found in the /05/Importing Vectors folder) in Illustrator and the companion ai_keyframes_01.fla file in Flash. You will see the beginnings of an interface, as layers are converted to keyframes upon import. In the next step of the process, shown in ai_keyframes_02.fla, simple scripts have been added directly to the buttons to mock up the tabs in action. Although a very simple example, this is an excellent way to get an interface working quickly in Flash if you are comfortable with a particular drawing program.
Special features in drawing programs can also be used to great advantage. For example, FreeHand's Xtra, Animate Release to Layers, can be used to turn shape tweens (called blends in the FreeHand vernacular) and groups into multi-layered files. Using the "Convert Layers to Keyframes" option in the vector import dialog discussed previously, you can then create an instant animation when importing the file into Flash.
If you have a recent copy of FreeHand, begin by opening flower_01.fh11, found in the /05/ Importing Vectors folder. Using the aforementioned Xtra, this single-layer file is turned into flower_02.fh11. Each element is repeated on a new layer, adding a new element each time. The result is an animation build that can be immediately translated into Flash.
If you don't have FreeHand, or you want to move on, import the result that has already been prepared for you:
When you are finished viewing the animation, close the .swf and return to your .fla. Open the Library and notice that six new symbols have been added to the file. These were originally FreeHand symbols, but they have been conveniently converted to Flash symbols for you. With a little advanced planning, FreeHand economies can make your Flash files more efficient, too.
Importing a SWF
In most cases, you can even import a .swf into your .fla file. (In a later chapter, you will learn how to protect your .swf files from importing, but for now, you will work with the default setting where protection is not enabled.)
When importing SWF files, you will not be able to import much more than graphics. However, this is still useful if you want to bring a SWF created by another program into a Flash file that you're working on.
Many third-party programs, including FreeHand and Illustrator, can create .swf files. These export options can even be used to create simple animations without ever opening Flash. Illustrator, in particular, can often provide better results in color and shape translations (especially from a CMYK original) by exporting a .swf that you then import into Flash, rather than importing the Illustrator or .swf document directly.
Exporting a .swf from a third-party tool is usually straightforward. Figure shows the Illustrator options, as an example. Note that you can convert layers to keyframes (or files, or create one composite file). You can also apply a small selection of settings for direct export to animation, preserve appearance or editability, and set bitmap compression settings for converting embedded bitmaps.
The export features in FreeHand and Illustrator (shown here) allow you to create SWF files directly from within these programs
Importing from PDF
Flash 8 can import PDF documents, using the same vector import dialog discussed previously. Depending on how complex the PDF is, Flash usually does a pretty good job of reproducing the original content.
In basic terms, importing a PDF is no different from importing an Illustrator or FreeHand file. However, the following project will give you a chance to experiment with Flash's Convert Pages to Scenes option. Although pages are supported in other applications, the idea of pages in a PDF is very intuitive and common, so you'll run with that idea now: