Home > Articles

Creating Graphics in Flash

This chapter is from the book

This chapter is from the book

In This Chapter

  • The Tools

  • Creating Custom Colors and Gradients

  • Tips for Creating Graphics in Flash

  • Graphic Techniques

  • Importing Bitmap Graphics

  • Working with Bitmaps

Flash has a unique drawing style associated with it. If you are familiar with other drawing applications, such as Adobe Illustrator and Macromedia FreeHand, you'll find definite similarities and some unexpected differences. Flash offers several drawing tools that allow you to create the graphics for your Flash projects that may seem familiar to you based upon some of those programs. Flash differs from those other applications by the way it handles graphics. Flash will join two items of the same color value if the two graphics intersect. The line or stroke of an item is also considered a separate element. As you will see in this chapter, these differences can be problematic; they can also work in your favor. It's just a matter of getting use to them.

The Tools

As just mentioned, the drawing and handling of graphics in Flash takes a little getting used to, and that's what this portion of the chapter is for. It exposes you to the tools in Flash MX, and even though they may look very similar to those in other programs, this is a different user experience.

All the tools will be reviewed in this chapter, so let's take a look at what these tools look like. Figure 3.1 shows the Flash MX toolbar and highlights each tool found in this powerful toolset.

Figure 3.1 The Flash MX tools.

The Arrow Tool

The Arrow tool is Flash's selection tool. If you want to move an item, select and drag it with this tool. Of course, you can always use the arrow keys on your keyboard to move the item for more precise placement.

Toward the end of the chapter, once we get into actually creating artwork in Flash, you'll see how this tool can also be an aid in drawing. The Arrow tool does have one option: Snap to Objects.

Use Snap to Objects to have artwork snap to the grid. This option will also cause objects to snap to one another when you're placing the graphics, depending on how close the objects are horizontally and vertically.

The Subselection Tool

The Arrow tool has a counterpart—the Subselection tool (also known as the white arrow). Remember that Flash is vector based, and the main job of the Subselection tool is to select actual vector points of an item. Again, we'll discuss this later in the chapter as we begin creating and working with our own artwork using the Pen tool.

The Line Tool

When drawing with the Line tool, you have the ability to create straight lines in any direction from the starting point. To start drawing a line, choose the Line tool in the Tools panel, click anywhere on the stage, drag the line towards the desired endpoint, and release the mouse. The Line tool has no options. However, the size and style of the stroke will determine the appearance of the line. The stroke's properties can be changed in the Properties Inspector when the Line tool is selected in the Tools panel.

Notice in Figure 3.2 that you can draw several line segments to make a shape.

To change the appearance of the stroke, you can select a color and size from the Properties Inspector. You also have a choice of styles—solid, dashed, dotted, ragged, stipple, and hatched—as well as options to customize each of these styles. Simply click the Custom button in the Properties Inspector with a drawing tool selected. Here's an explanation of each style option:

Figure 3.2 The Line tool can be used to draw a triangle by connecting three different lines. Notice the Properties Inspector's options for changing the line's appearance.

NOTE

Flash does not offer a way to save custom style settings. Also, all units for spacing and sizing options are in points. You can access the Stroke Style dialog box by clicking the Custom button in the Properties Inspector. Once you click the button, the dialog box will appear, as shown in Figure 3.3.

Figure 3.3 The Stroke Style dialog box.

  • Hairline. This stroke style draws one-pixel-wide strokes and remains one pixel, regardless of magnification or zoom. Oftentimes, when a document gets scaled, the vector lines will scale with it to preserve the proportions of the artwork. This is not an option in the dialog box but is available through the pop-out menu in the Properties Inspector.

  • Solid. This option is for drawing solid lines and strokes. The only adjustable attributes are the thickness, color, and sharp corners of the stroke.

  • Dashed. This choice generates a stroke with dashed breaks within the line. To change the length of the dash and the gap space between dashes, enter in numeric values in the respective text fields. Color, thickness, and sharp corners are also adjustable attributes.

  • Dotted. Choose the dotted style if the desired effect is to have a stroke with evenly spaced dots along the line. This style has an option for changing the distance between the dots. Color, thickness, and sharp corners are also adjustable attributes.

  • Ragged. The ragged style creates random wavy lines with dotted separations. The Stroke Styles dialog box offers options to change the pattern, wave height, and wave length. Color, thickness, and sharp corners are also adjustable attributes. Use a combination of all these styles for unlimited possibilities.

  • Stipple. This choice creates a stroke style to resemble that of an artist's hand-stippling technique. Dot size, dot variation, and density are options for changing the appearance of the stippling effect. Color, thickness, and sharp corners are also adjustable attributes.

  • Hatched. The hatched line style resembles an artist's hatched-line technique. The Thickness attribute determines the thickness of the hatch line, which is independent of the global thickness setting. You also have options for spacing, jiggle, rotate, curve, and the length of the hatched lines. Of course, there are additional choices for global thickness, color, and sharp corners.

The Ink Bottle Tool

The Ink Bottle tool is designed to change the color, style, and thickness of strokes. If you use the Dropper tool to sample the stroke appearance of any art in Flash, after the sample has been made, the Dropper tool will automatically take on all the characteristics of the sampled stroke. The Ink Bottle does not have any options, but you can choose the color, thickness, and style of the stroke using the Properties Inspector in conjunction with one of the vector drawing tools.

The Dropper Tool

Use the Dropper tool to select color values on the screen. If you are drawing a new object and prefer for the fill or stroke color to appear the same as any other value on the screen, simply use the Dropper tool to sample that color value. Once you click the color value, it's automatically stored in the appropriate Ink Well tool in the Tools panel. If you choose a stroke color, all attributes of that stroke (including size, color, and style) will be sampled. If you are using the Dropper tool from the Tools panel, you are limited to sampling within the confines of the stage. If you are using the Dropper tool built in to the Swatches panel, you can sample a color from any source on the computer screen.

The Pencil Tool

When drawing with the Pencil tool, you'll notice it uses a stroke color opposed to a fill color. You may also change its stroke appearance by choosing a stroke style in the Properties Inspector. The Pencil tool has some interesting options that can aid in the final outcome of a drawing. These options are detailed in the following list and displayed in Figure 3.4:

Figure 3.4 Pencil tool options.

  • Straighten. Choose this option if your goal is to draw a perfect circle, oval, square, rectangle, or arc. The sensitivity of how Flash determines a shape is set in the Preferences dialog box. You can access these preferences by choosing Edit, Preferences. For more information on preferences, refer to Chapter 2, "Introducing Flash MX." Check out Figure 3.5 to see an example of drawing with Straighten turned on.

Figure 3.5 A circle before and after the release of the mouse.

  • Smooth. Generally this option will smooth out any curvy lines.

  • Ink. This choice is for freehand drawing without Flash making adjustments to the lines.

TIP

When you're drawing with the Ink option selected, it may look like some modification is happening to your lines when the mouse is released. Flash isn't making any adjustments to the curviness or straightness of the line; rather, it's antialiasing the edges of the line.

After the line has been drawn, you may feel that it needs to be smoother or straighter. This not only may aid in the visual appearance of the stroke, but you may actually reduce file size by reducing the complexity of the stroke. To make a line straighter, follow these steps:

  1. Click the line with the Arrow tool. The line will be selected.

  2. With the line selected, in the Options portion of the toolbar, as shown in Figure 3.6, choose the Straighten button.

  3. Click the Straighten button as many times as needed to get the desired effect.

The same method will work when smoothing a line.

Figure 3.6 The Arrow tool's options.

The Rectangle Tool

Rectangle tool is used to create squares and rectangles. To create a perfect square, hold down the Shift key to constrain the drawn object's proportions to that of a square. One option the Rectangle tool has involves setting the corner radius to make rounded edges. If you click the Corner Radius button, a dialog box will appear. In the text field, type in a numeric value between 0 and 999 that represents the corner radius.

Drawing and Coloring Rectangle Shapes

Here are the steps to follow to draw and color a rectangle shape:

  1. Choose the Rectangle tool from the Tools panel.

  2. In the Color portion of the Tools panel, choose a stroke color. If no stroke is desired, choose the first box in the top-right corner of the swatches, as shown in Figure 3.7.

  3. If you would prefer to use a custom color, something other than a web safe color, click the button to the right of the No Stroke button to bring up the Color Picker. Inside the Color Picker are many different ways to view color in terms of organization.

  4. Choose a fill color. All the same techniques in terms of color selection used for the stroke apply to the fill as well.

  5. To create rounded edges, click the Round Rectangle Radius button in the Options section of the Tools panel.

  6. Place the cursor in the stage; then click and drag until the rectangle is the desired size. If the goal is to create a perfect square, hold down the Shift key.

Figure 3.7 Choosing the No stroke option.

NOTE

If you choose View, Snap to Objects when you draw a rectangle, you'll notice you have a perfect square because your cursor will snap to a large circle around your cursor, as shown in Figure 3.8.

CAUTION

The higher the value entered in the Round Rectangle Radius dialog box, the more round the corners become. Avoid very large numbers, especially for smaller rectangles. If you do use a large number, you run the risk of turning your rectangle into a circle.

Figure 3.8 Drawing a square with Snap to Objects selected.

When using the Rectangle tool, you may notice some unusual behavior when it comes to moving objects. This is discussed in detail in the "Tips for Creating Graphics in Flash" section, later in this chapter.

The Oval Tool

The Oval tool is used to create circles and ovals. To create a perfect circle, hold down the Shift key. This will constrain the drawn object's proportions to that of a circle. If Snap to Objects is selected when drawing an oval, the shape will snap to a perfect circle when dragged at a 45-degree angle.

The Oval tool has no options.

The Paint Bucket Tool

The Paint Bucket is used to fill an item with a color or gradient. To choose a color or gradient, click the Ink Well tool of the fill swatch in the Tools panel or in the Properties Inspector.

Once the fill color has been selected, move the Paint Bucket tool over an object and click it to change its fill color to the new fill color.

In the Options area of the Tools panel, notice that the Paint Bucket tool has a Gap Size option as displayed in Figure 3.9.

Figure 3.9 The Paint Bucket options.

Select the first choice, Don't Close Gaps, if there are certain areas in your artwork that shouldn't be filled.

The Close Small, Medium, and Large Gaps options all work in the same way. If you have complex drawings that need to be filled, you may want to choose one of these options. If you have Close Large Gaps selected and it doesn't seem like it's working, either the gap is too large or there are too many gaps in your art.

The last option in the Tools panel is Lock Fill, which allows you to apply a gradient or bitmap fill consistently across multiple items.

Using Lock Fill to Apply a Gradient Across Multiple Objects

Here are the steps to follow to use Lock Fill to apply a gradient across multiple objects:

  1. Draw four squares on the stage and align them using the Align panel. Space them out so that the entire stage is being used, edge to edge.

  2. Choose the Paint Bucket tool in the Tools panel and be sure to choose the rainbow linear gradient in the fill swatch.

  3. Click the Lock Fill button in the Options portion of the Tools panel.

  4. Fill the first square, then the second, third, and fourth. You'll notice that the gradient is being applied as if the four squares are one continuous shape.

  5. To see the different squares, fill each one with a gradient without the Lock Fill option selected.

  6. To apply a gradient across multiple items without using Lock Fill, simply choose all the items by drawing an invisible marquee with the Arrow tool or by Shift-clicking each object. Then click one of the items. You'll notice the gradient has applied color across more than one item. The effect, however, looks a bit different when compared to the Lock Fill effect.

If you want to fill the squares with a bitmap, choose File, Import and search for the image on your computer. Once the image is in Flash, highlight it and choose the Modify, Break Apart menu command. For more information on importing bitmap graphics, see the "Working with the Color Mixer" section, later in this chapter.

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