What is Software? | What is Education? | What is Technology? | What is Research? | What is Wi-Fi? | What is Communication? | What is Customer Service?

Free SEO Tutorials & Help

Tutorials:   Adobe Flash   Adobe Photoshop   CorelDRAW   SEO  

Site Map

Website Development | Cable & Broadband Magazine | Solutions for Higher Education | Auction Anything Online

Adobe Flash Help & Tutorials

 Back to Topics

 

    How to Create Graphics: Applying Gradients in Flash

Creating Graphics: Applying Gradients

Examine the completed FLA file

Open the starter document

Apply a linear gradient

Create a radial gradient

Create a transform gradient with a shape

Apply the finishing touches

Test the application

Creating Graphics: Applying Gradients

TOP

This tutorial guides you through the process of using the gradient tools in Macromedia Flash Basic 8 and Macromedia Flash Professional 8. With Flash, you can create simple color gradients and complex gradient effects. In this tutorial, you learn how to do some of both.


A gradient is an area of a graphic where one color changes into another color. Flash can create two main types of gradients: linear and radial. Linear gradients change color along a single axis, such as horizontal or vertical. A radial gradient changes color in an outward direction starting from a focal point. You can adjust the direction of the gradient, its colors, the location of the focal point, and many other properties of gradients.

 
The following illustrations show the two types of gradients:



A two-color linear gradient from red to black



A two-color radial gradient from red to black


This tutorial takes you through the steps to create an illustration using an assortment of gradients.

 

Examine the completed FLA file

#TOP

As you examine the finished version of an application you'll create, you will also look at the Flash workspace.

In this section, you will complete the following tasks:

  • Open the authoring document

  • Review the completed FLA file

  • Close the completed FLA file

In subsequent sections, you'll go through the steps to create the application yourself.


Open the authoring document


It's helpful to analyze the completed authoring document, which is a FLA file, to see how the author designed the illustration and understand what you are going to create.

The files for this tutorial are located in the Samples and Tutorials folder in the Flash application folder. For many users, particularly in educational settings, this folder is read-only. Before proceeding with the tutorial, you should copy the entire gradient tutorial folder to the writable location of your choice.

  • On most computers, you will find the Gradients tutorial folder in the following locations:

  • In Windows: boot drive\Program Files\Macromedia\Flash 8\Samples and Tutorials\Tutorial Assets\Creating Graphics\Gradients.

On the Macintosh: boot drive/Applications/Macromedia Flash 8/Samples and Tutorials/Tutorial Assets/Creating Graphics/Gradients.

Copy the Gradients folder to another location on your hard disk that you have write-access to. In the Gradients folder, you will find a Flash file called gradients_finished.fla. Double-click the file to open it in Flash. You now see the completed tutorial file in the Flash authoring environment.

Review the completed FLA file

In the completed FLA file, you will see the combined effects of several gradients. The illustration looks like this:

There are five gradients in the illustration:

  • A gradient from black to green on the background.

  • A gradient from black to green to black on the bottom of the eight ball.

  • Another from white to black in the highlight on the top of the eight ball.

  • A subtle gradient on the white circle surrounding the number "8."

  • A radial gradient in the shadow beneath the eight ball.

Close the completed FLA file


To close the document, select File > Close.


If you prefer to keep the finished file open as a reference while working with the starter file, be careful not to edit it or save any changes to it.
 

 

Open the starter document

TOP

Now that you have seen the completed file, it is time to create your own Flash document. To get started, you'll open a starter file that contains a few graphics to which you will apply gradients.

  1. In Flash, select File > Open.

  2. Navigate to the following directory:

    • In Windows: Hard Disk\Program Files\Macromedia\Flash 8\Samples and Tutorials\Tutorial Assets\Creating Graphics\

    • On the Macintosh: Hard Disk/Applications/Macromedia Flash 8/Samples and Tutorials/Tutorial Assets/Creating Graphics/

  3. Open the gradients_start.fla file.
     

Apply a linear gradient

TOP

In this section you will add a linear gradient to the background.

  1. Click the Selection tool in the Tools panel.

  2. Select the gray box in the layer named Background.

  3. Select Window > Color Mixer to display the Color Mixer panel.

  4. In the Color Mixer's Type pop-up menu, select Linear.

  5. Double-click the right gradient color swatch and select the color green (#006600).

    Selecting the right gradient color swatch in the Color Mixer

    Selecting the color green #006600 in the Color Picker

  6. Double-click the left gradient color swatch and select the color black (#000000).

  7. Select the Gradient Transform tool from the Tools panel. The Gradient Transform controls appear on the Stage around the gradient.

    The Gradient Transform tool

  8. Drag the Gradient Rotate handle to rotate the linear gradient clockwise as shown.

    The Gradient Rotate handle

    Rotating the gradient clockwise

  9. Lock the Background layer in the Timeline to prevent further changes to this layer.

  10. Select File > Save to save your FLA file.

 

Create a radial gradient

TOP

Next, you will add a radial gradient to the black eight ball.

  1. Double-click the black circle in the layer called Ball. This opens the group containing the eight-ball shape.

  2. Select the black circle shape. You will apply a gradient to this shape. Do not select the number "8" on the eight ball.

  3. In the Color Mixer panel select Radial from the Type pop-up menu. Select Mirror Overflow mode from the Overflow pop-up menu.

    The correct Radial Type and Mirror Overflow settings

  4. Double-click the left gradient color swatch and select the color black (#000000).

  5. Double-click the right gradient color swatch and type 002200 into the color text box. Press Enter.

  6. Drag the left gradient color swatch to the right about three-fourths of the way as shown in the following illustration. This makes the green part of the gradient appear only in the outer 25% of the ball shape.

    Dragging a gradient color swatch

  7. Select the Zoom tool from the Tools panel and click the circle shape to magnify it.

  8. Select the Gradient Transform tool in the Tools panel.

  9. Rotate the radial gradient 90 clockwise by dragging the Gradient Rotate handle.

    Dragging to rotate the gradient 90 clockwise.

  10. Select the Focal Point control and drag it near the top of the circle.

    Dragging the Focal Point control toward the top of the circle shape

  11. Select the center control point and drag the entire gradient upward a short distance as shown in the following illustration. The mirrored overflow gradient is at the bottom of the circle.

    Dragging the center control point upwards

  12. Select the Selection tool in the Tools panel.

  13. Double-click the Zoom tool to return the Stage area to a view of 100%.

  14. Double-click the Stage area to deselect the eight-ball group.

  15. Select File > Save to save your FLA file.

 

Create a transform gradient with a shape

TOP

In this section, you will create a gradient and then use the Free Transform tool to change its shape.

  1. Select the Shadow layer in the Timeline.

  2. Select the Oval tool in the Tools panel.

  3. Hold down Shift and then drag on the Stage with the Oval tool to draw a circle approximately 150 pixels square. This should be about the same diameter as the eight ball.

  4. In the Color Mixer's Type menu, select Radial.

  5. Move the left gradient color swatch all the way to the left. You should have one swatch all the way to the left and one all the way to the right.

  6. Double-click the left swatch and select the color black (#000000) in the Color Picker.

  7. Double-click the right swatch to display the Color Picker.

  8. Select the color black (#000000).

  9. In the Color Picker, drag the Alpha slider down to zero. This creates a gradient from black to transparent, allowing the green background to show through the edge of the circle you just drew.

  10. Select the Gradient Transform tool from the Tools panel and drag the Focal Point control of the gradient back to the center of the circle.

  11. Select the Free Transform tool and scale the circle along the y (vertical) axis by dragging the top-center handle downward as shown in the following illustration.

    The gradient is transformed along with the shape transformation.

  12. Select the Selection tool from the Tools panel.

  13. Drag the shadow shape under the eight ball with the Selection tool.

  14. Click outside the Stage to deselect the shadow.

  15. Select File > Save to save your FLA file.


 

Apply the finishing touches

TOP

To complete the illustration, you will apply two more linear gradients: one to the white circle on the eight ball and one to make a highlight on the top of the eight ball.

Apply a gradient to the white circle on the eight ball

Next you will add a gradient to the white circle on the eight ball graphic.

  1. Select the Selection tool from the Tools panel.

  2. Double-click the eight ball group to edit the group.

  3. Double-click the white circle group.

  4. Select the white circle shape.

  5. In the Color Mixer panel, assign the white circle shape a linear gradient by selecting Linear from the Type menu.

  6. Select Nonrepeating from the Overflow menu.

  7. Drag the left gradient color swatch all the way to the left and double-click it.

  8. Select the color white (#FFFFFF) from the Color Picker.

  9. Set the Alpha value for the white color swatch to 100%.

  10. Drag the right color swatch all the way to the right and double-click it.

  11. Select the color black (#000000) from the Color Picker.

  12. Set the Alpha value for the black color swatch to 100%.

    Your gradient settings should match those in the following illustration:

    The Color Mixer with the correct settings for the gradient on the white circle

  13. Select the Gradient Transform tool from the Tools panel.

  14. Drag the Gradient Rotate handle approximately 120 clockwise.

    The gradient rotated 120

  15. Select the Selection tool in the Tools panel.

  16. Double-click the Stage twice to exit the white circle group and the eight-ball group.

  17. Select File > Save to save your FLA file.

Apply a linear gradient to the highlight

In this section you will apply a linear gradient.

  1. Click the red X icon in the layer named Highlight to reveal the shape in that layer. The shape appears at the top of the eight ball.

  2. With the Selection tool, double-click the highlight shape to edit its group.

  3. Select the highlight shape.

  4. In the Color Mixer, select Linear from the Type menu.

  5. Select Non-repeating from the Overflow menu.

  6. Drag the left gradient color swatch all the way to the left and double-click it.

  7. Select the color white (#FFFFFF) from the Color Picker.

  8. Set the Alpha value for the left swatch to 0%.

  9. Drag the right gradient color swatch all the way to the right and double-click it.

  10. Select the color white from the Color Picker.

  11. Set the Alpha value for the right swatch to 75%.

    Your gradient settings should match those in the following illustration:

    The Color Mixer with the correct settings for the gradient on the highlight shape

  12. With the highlight shape still selected, select the Gradient Transform tool from the Tools panel.

  13. Drag the Gradient Rotate control 90 counterclockwise.

  14. Drag the Gradient Scale control downward until it touches the top of the highlight shape.

    The Gradient Scale control

    Dragging the Gradient Scale control downward to touch the highlight shape

  15. Select the Selection tool from the Tools panel.

  16. Double-click outside the Stage twice to deselect the highlight group.

    The finished Flash illustration looks like this:

  17. Select File > Save to save your FLA file.

 

Test the application

TOP

At any point during authoring, you can test how your application plays as a SWF file. Because this tutorial contains no animation or interactivity, the file will look the same in test mode as it does in authoring mode.

  1. Select File > Save to save your FLA file.

  2. Select Control > Test Movie.

  3. When you finish viewing the application, close the SWF file by clicking the close box in the test window.

You have now successfully applied a variety of gradients in Flash and created an attractive and realistic-looking illustration. By using the gradient tools in Flash, you can create an infinite range of visually interesting graphics and effects.

 

 

Copyright ADOBE - All Rights Reserved Worldwide

 

 

More Topics:

Working with Flash Documents

How to work in Flash WorkSpace

Working with Projects in Flash

Process to Build your First Application in Flash

Using Symbols, Instances and Library Assets in Flash

How to Build Video Player in Flash

How to Work with Color, Strokes and Fills in Flash

How to Create Document in Flash

What is Vector and Bitmap Graphics in Flash

How to Create a Banner in Flash, Part 1

How to Work with Text in Flash

How to Create a Banner in Flash, Part 2

How to Use Imported Artwork in Flash

How to Create a Banner in Flash, Part 3

How to Work with Graphic Objects in Flash

How to Work with Layers in Flash

How to Use Filters and Blends

Working with Graphics in Flash

What is Accessibility Features in Flash

How to Create Motion (Shape Tween & Motion Tween) in Flash

How to Create an Application in Flash

What is Masking in Flash

How to Work with Video in Flash

How to Use Layout Tools in Flash

What are Behaviors in Flash

How to Work with Sound in Flash

How to Create Symbols and Instances in Flash

What is ActionScript in Flash

How to Write ActionScript With Script Assist in Flash

How to Add Button Animation and Navigation in Flash

What is Data Integration in Flash

How to Work with Screens

How to Create a Presentation with Screens

What is Extending Flash

How to Create Multilanguage Text in Flash

How to Create Graphics: Draw in Flash

What is Flash Lite

Ways of Data Integration

How to Create Graphics: Create a Timeline Animation in Flash

Getting Started with Flash Lite in Flash

How to Publish Flash Documents

How to Create Graphics: Making Animations with Easing

Learning Flash Lite 1.X ActionScript in Flash

How to Export Flash Content and Images from Flash

How to Create Graphics: Applying Gradients in Flash

Process of Writing and Editing ActionScript 2.0 in Flash

How to Create Accessible Content in Flash

How to Create Graphics: Apply Graphic Filters and Blends

What is Data and Data Types in Flash

Process of Printing from SWF Files in Flash

Using ActionScript: How to Use Script Assist mode in Flash

Learn Syntax and Language Fundamentals in Flash

How to Create E-learning Content in Flash

Using ActionScript: How to Write Scripts in Flash

Working with Functions and Methods in Flash

Process of Using Templates in Flash

Using ActionScript: Process of Adding Interactivity in Flash

What are Classes in Flash

Control Tag Summary of XML to UI in Flash

Using ActionScript: How to Create a Form with Conditional Logic and Send Data in Flash

What is Inheritance in Flash

What is Data Integration: Overview

Using ActionScript: How to Work with Objects and Classes in Flash

Overview on Interfaces in Flash

What is Data Integration: Using XML for a Timesheet

How to Work with Text and Strings in Flash

How to use Handling Events in Flash

What is Data Integration: Using XUpdate to Update the Timesheet

Learning Animation, Filters and Drawings in Flash

How to Work with Movie Clips in Flash

How to Create Interaction with ActionScript in Flash

How to Work with Images, Sound, and Video in Flash

How to Work with External Data in Flash

What is Security in Flash

How to Debug Applications in Flash

List of Error Messages in Flash

Using Object-Oriented Programming with ActionScript 1.0 in Flash

How to Write Scripts for Earlier Versions of Flash Player in Flash

List of all Keyboard Keys and Key Code Values for using in Flash

Terminology

Introduction to Components in Flash

What are Components in Flash

How to Create an Application with Components

How to Work with Components in Flash

How to Handle Component Events in Flash

How to Customize Components in Flash

How to Create Components in Flash

What is Collection Properties in Flash