Home > Articles > Graphics & Web Design > Dreamweaver & Flash

This chapter is from the book

Importing Vector Graphics

There may be times when you have an existing vector graphic that needs to be included in your Flash movie. Typically, such a vector graphic is likely to be geometric—although not necessarily. Regardless of the exact form of the vector graphic, unless it's super complicated, you'll be able to import it into Flash.

From File

One way to incorporate other graphics into Flash is to import them from a file. It's as simple as selecting File, Import and pointing to the file you want, as shown in Figure 3.1. You will see several file types listed, but that doesn't mean they all work equally well. Not only are several image file formats listed (both raster and vector), but video and audio file formats also appear. Let's first look at the vector image formats available for import.

Although many file types are listed in the Import dialog box, only four vector formats are worth considering: FreeHand (.FH10 through .FH7), Illustrator (.ai), Illustrator EPS, and Flash Player (.swf). Generally, the best option is FreeHand. The only Illustrator versions supported are 3.0 through 6.0 and version 8.0. Artists working in Illustrator versions newer than 8 (which is very likely, as 8 is pretty old) can simply save a copy and select version 8 or lower (but not 7.0—don't ask me why). Unfortunately, this occasionally means that certain visual elements are lost. The most important concern is that the artist always retain a copy of the source file matching the version of Illustrator he uses. Because of this limit, when using Illustrator you'll see the best results if you export a .swf (Flash) file from Illustrator. (Some older versions of Illustrator require that you download and install Macromedia's free "Flash Writer" plug-in in order to export .swfs.) We'll discuss how this choice affects importing in the later section "Importing Flash Player Files."

Figure 3.1 Importing images (or audio) is as simple as selecting the file you want to import.

If all you have is an .ai file, you could try importing it into Flash. It will be painfully obvious if it doesn't work properly. The image will look nothing like what you expect, as you can see in Figure 3.2. This indicates that the .ai file was saved in a version number greater than 6, and Flash can't interpret the file. You must open the file in Illustrator (a new version) and then either save as version 6 or export a .swf instead.

Figure 3.2 Upon importing an unsupported file format (in this case a version 9.0 Illustrator file), you'll often see an error dialog box like one of these.

Importing FreeHand Files

Flash can seamlessly import FreeHand source files. If you're familiar with FreeHand, this is probably the best way to import vector art into Flash. It's simply a matter of selecting File, Import in Flash and selecting a FreeHand file to import. You'll be presented with the FreeHand Import dialog box, as shown in Figure 3.3.

Figure 3.3 After importing a FreeHand file, Flash provides this dialog box.

Several options are available when you import FreeHand documents into Flash. The Mapping choices let you specify how Flash deals with features unique to FreeHand. For example, if your FreeHand file has "pages," Flash needs to know how it should handle them. All the options are fairly easy to interpret and are selected upon import into Flash. But you can do a few things (ahead of time) while in FreeHand to make the import smooth.

Here are some tips to help your drawings import into Flash. First, you should take advantage of FreeHand's symbols because these will translate directly to Flash's symbols so that graphics can be recycled. We'll discuss symbols and Flash's Library in Hour 5, "Using the Library for Productivity." Also, each object created in FreeHand should be separated into its own layer. Although you can easily put multiple objects on one layer, the file will import better if you create multiple layers.

There are many text effects that you can do in FreeHand that won't translate to Flash. For example, text attached to paths won't remain editable once in Flash. Also, because only FreeHand supports strokes on text, this effect will be ignored by Flash. Fine adjustments to font sizes (and kerning) are possible in FreeHand (but not as well in Flash), so font spacing often changes slightly once inside Flash. Sometimes text from FreeHand will automatically convert to paths (which means it won't be editable once inside Flash). I discuss converting to outlines as a solution to some text problems in the section "Steps to Maintain Image Integrity" because it can resolve some of these issues. These are just some general tips. Creating the smallest, best-looking image that imports seamlessly into Flash might take some additional experimenting in FreeHand.

Importing EPS Files

Another vector format supported is Encapsulated PostScript (EPS). Unfortunately, many variations of this file format exist, such as Photoshop EPS, but the only one Flash supports is Illustrator EPS. The best way to find out whether your file works is to test it and see. Not only will your images look wrong if it's not working, but you'll likely see the dialog box similar to those in Figure 3.3 above.

Of all the options that work, importing EPSs is the worst because it doesn't work reliably. It might work properly under one set of circumstances and then fail to work for another situation. If your testing involves truly representative samples, you'll be fine—but that's easier said than done.

Importing Flash Player Files

Finally, the most reliable option for importing vector graphics into Flash (besides, possibly, simply importing native FreeHand files) is to import Flash Player files (.swf). Most graphics people don't think of .swf as a file format, but it's certainly a standard. Of course, an .swf is not like a FreeHand or Illustrator file because it's not fully editable. As of FreeHand 9 and Illustrator 9 (Illustrator 8 requires the free Macromedia "Flash Writer" plug-in), you can export your working files into the .swf format. They export amazingly well. The proof can be seen in two measures: The final files are smaller, and the image retains all the details and quality of the original.

The best process is to create a graphic in whatever program you prefer, and then open it in a program that exports .swfs and simply export it as an .swf. You can then import it directly into your movie. Even if the graphics program you use doesn't support exporting .swfs, open the file in a tool that does and export an .swf from there. This means that the graphics tool you select must export files in a format that is supported by the tool you use to export .swfs.

If you have trouble with the process of exporting .swfs from the graphics program and importing into Flash, you can try several remedies. First, investigate the export options in the graphics program. In Figure 3.4, you can see dialog boxes that appear when exporting .swfs. Without explaining each option, you should notice similarities among all three. Experimenting with these options is a good place to start.

In addition to the export to .swf options, there are a few specific techniques you can try (covered in the section "Steps to Maintain Image Integrity," later in this hour). Ultimately, however, the solution sometimes involves making the graphic simpler—that is, reducing its complexity.

From Other Programs

The following technique works, but not very well. I mention it because it usually works well for simple graphics, and it's very quick. You simply open your graphics file in any graphics creation tool while Flash is open. Select and copy the contents (or some of the contents), effectively putting that image in your Clipboard. Go to the open Flash file and paste.

Figure 3.4 When exporting an .swf from FreeHand or Illustrator, you're given one of these dialogs.

If you do use this technique, you should open the Clipboard tab in Flash's Edit, Preferences dialog box (see Figure 3.5). From there you'll find several options in addition to the bitmap settings (namely, the gradient quality and editable text options).

Figure 3.5 Flash's Clipboard preferences provide an option to maintain FreeHand text formatting.

This sounds pretty simple compared to the previous section—but don't be fooled, it doesn't always work well. What actually happens is that the content of your Clipboard is converted to a particular file format. It varies as to what format, but it goes through a process similar to exporting an .eps then importing the .eps—it just happens automatically (and without your control). If it works, great. If not, go back to the other import options (exporting .swfs, .ai, or .eps), or better yet, draw it from scratch inside Flash.

Steps to Maintain Image Integrity

Despite how simple the export/import process may sound, it can be very frustrating when it doesn't work! Not to sound like a broken record, but the best way to maintain image quality is to create all your graphics inside Flash. For the times you must import an existing graphic or use a more advanced drawing tool, you can do several things to maintain image integrity. However, some of these tips are unnecessary when exporting .swfs from either Illustrator or FreeHand.

Font and text effects are usually the first things to go. Most drawing tools provide incredible font control, but Flash doesn't. The first consideration with text is whether the text must be editable within Flash. If you don't need to edit your text within Flash, you'll see the highest quality results if your text is first converted to paths. You'll find an option to do this automatically when exporting .swfs from FreeHand, and it doesn't affect the source FreeHand file—just the exported .swf. FreeHand's Convert to Paths feature is the same as Illustrator's Create Outlines and is equivalent to Flash's Break Apart option under the Modify menu. Of course, you'll never be able to edit the text after you do this, so you should save a backup first. In addition, this can tend to make your file size increase. We'll look at file size issues in much greater detail in Hour 20, "Optimizing Your Flash Site."

If you use gradients, you should definitely consider the Export .swf option. This is more important to keep the file size down and performance speed up (rather than simply retaining quality). A simple gradient, for example, will often include a separate circle for each step. Imagine hundreds of concentric circles, each varying only slightly in color and size. You can see this effect when you pick up and move an imported graphic with this characteristic, as in Figure 3.6. It's easy to see that such a gradient creates a larger file and one that plays more slowly—it's simply more complicated than it needs to be. When you export .swfs from Illustrator or FreeHand, the gradients are converted to Flash gradients. (Next hour you'll learn how to create and edit gradients inside Flash.)

Figure 3.6 Often an imported graphic is much bigger than it needs to be. This seemingly innocuous gradient is actually lots of individual concentric circles.

Going Back and Forth Between Flash and Other Vector Programs

Say you import a graphic created elsewhere, edit it in Flash, and then decide you need to touch it up again (in the original program). Doing so is not unreasonable or unexpected, but it doesn't work too well. Because it often fails to work, it's fair to question whether it's really necessary. Of course, if you just use Flash to create your graphics, this situation will be avoided—but the other drawing tool was probably chosen because it is more sophisticated. Because the other tool is so great, why not start over in that tool instead of trying to import the modified Flash graphic?

The best way to export an editable vector graphic from Flash is as an Adobe Illustrator .ai file. In the simplest case, you'll need to export just a still frame. For this, use Flash's File, Export Image menu and select Adobe Illustrator from the Save as Type drop-down list. This file can be opened in any drawing tool that supports .ai files (including Illustrator and FreeHand). No one can promise this will work without fail, but it seems to work better than other options.

If you just have a simple graphic, you can try the copy and paste technique. It usually works for simple graphics, although when you bring the graphic back to Flash, it will be different. For example, you might not be able to bend the line portions of a shape the way you could before it was taken to another program.

I've used a lot of techniques, and the only thing that is consistent is that you'll want to test several options until you find one that works well. The following summarizes the main points of this section:

  • Try to create all your graphics inside Flash.

  • If you use another program to create the graphics, try to refrain from making the file too complicated.

  • If you must import files from another vector program, the best method is to allow the other program to export an .swf file (which, in turn, can be easily imported into Flash).

  • A close second to the .swf option is to create your graphics in FreeHand and let Flash import the native FreeHand format. Although this might be the most convenient method, the files are not optimized automatically. So, you need to be familiar with FreeHand. The big advantage of this method is that image elements remain editable so you can make tweaks once inside Flash.

  • If you need to export from Flash to another program and then bring it back to Flash (which is really asking for trouble), the most reliable method is to select File, Export Image and make it an Illustrator .ai file.

  • Finally, you're always best off testing your options to carefully determine the impact on file size and performance, as we'll explore in depth in Hour 20.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020