Change the background color

1.12.2006, 1:22
Submited in: Flash | Total Views: 103833

In this tutorial, you will see how to change the background color, using the Action Script and flash 8. You will also learn how to use instance name, how to use drag and drop technique, how to create action script for this example and more.

Step 1

Create a new flash document and set Width to 300, and Height to 250px.

Step 2

Double click on layer 1 to rename its name in background. Then, insert a new layer and name it background change.

Step 3

Select the background change layer, take the Rectangle Tool (R), Stroke color must be switched off, under Fill color set any color and draw a "rectangle" 300x250px, as the background. After that, using the Align Panel (Ctrl+K), ceneter it with background. See the picture below.

Step 4

While the "rectangle" is still selected, press F8 key (Convert to Symbol) to convert it into a Movie Clip.

Step 5

Then, open the Properties Panel (Ctrl+F3), and under <Instance Name> type BackgroundChange.

Step 6

Double click on a new made Movie Clip, or choose right click and Edit in Place.

Step 7

Using drag and drop technique, move the first frame on frame 2. Look at the picture below!

Step 8

Click on frame 3, and press F6. After that, change the background color on the color which you like.

Step 9

Insert a new layer and name it Action.

Step 10

Select the Action layer, click on the first frame, open the Action Script Panel (F9), and paste this script:


Step 11

Click on frame 2, press F6, and in Action Script Panel (F9), paste this script:


Step 12

Click on frame 3, press again F6, and paste this script:


Step 13

Go back on the main scene (Scene1), insert a new layer, and name it button.

Step 14

Then, create the button, and set it on the position which you like.

Step 15

Select the Button, open the Action Script Panel (F9), and paste this script:

on (release) {
tellTarget ("/BackgroundChange") {

We're done!

Download example

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category

Most popular tutorials