Macromedia Flash - RGB color slider

This tutorial will help you learn how to create a set of RGB color sliders in the Flash 8 program. Please follow the steps of the lesson sequentially or download the source file for reference.

This tutorial will help you learn how to create a set of RGB color sliders in the Flash 8 program. Please follow the steps of the lesson sequentially or download the source file for reference.

Step 1

Create a new flash file. Go to Modify > Document ( Ctrl + J ). Set the width of the flash file to 450 x 350px . The background color you can set arbitrarily, in this lesson I will use white. Set the frame rate to 14fps or whatever you want.

Step 2

Pick the Rectangle Tool ( R ). In the Properties Panel select the Fill color to be red, Stroke color choose no color, then draw a rectangle with dimensions of 5x 225px .

images 1 of Macromedia Flash - RGB color slider
Images 1 of Macromedia Flash - RGB color slider

images 2 of Macromedia Flash - RGB color slider
Images 2 of Macromedia Flash - RGB color slider

Step 3

Take the Rectangle Tool (R) and continue drawing a horizontal rectangle (to make the color control bar) with a size of 40 x 10px and place it as shown below.

images 3 of Macromedia Flash - RGB color slider
Images 3 of Macromedia Flash - RGB color slider

Step 4

Select the entire slider ( Ctrl + A ) and press F8 key ( Convert to Symbol ) to convert it into a Movie Clip.

images 4 of Macromedia Flash - RGB color slider
Images 4 of Macromedia Flash - RGB color slider

Step 5

When the Movie Clip created (slider) is still selected, go to the Properties Panel ( Ctrl + F3 ). On the left side of Properties you will find the entry, enter the name in the field that is RedSlider

images 5 of Macromedia Flash - RGB color slider
Images 5 of Macromedia Flash - RGB color slider

Step 6

Grab the Selection Tool (V) and double click on the Movie Clip. You will edit inside the movie clip

images 6 of Macromedia Flash - RGB color slider
Images 6 of Macromedia Flash - RGB color slider

Step 7

Select the Selection Tool (V) and select only the horizontal slider (created in step 3). Press F8 ( Convert to Symbol ) to convert it into a Movie Clip.

images 7 of Macromedia Flash - RGB color slider
Images 7 of Macromedia Flash - RGB color slider

Step 8

When the horizontal slider is still selected, go to the Properties Panel and enter RedControlBar in the box. See the picture below.

images 8 of Macromedia Flash - RGB color slider
Images 8 of Macromedia Flash - RGB color slider

Step 9

Using the Selection Tool, select once the horizontal slider, open the Action Script Panel (F9) and enter the following code:

onClipEvent ( load ) {
top = _y ;
bottom = _y +224;
left = _x ;
right = _x ;
}

Step 10

Close the Action Panel (F9) and select the Selection Tool (V). Double click on the newly created Movie Clip (horizontal slider)

images 9 of Macromedia Flash - RGB color slider
Images 9 of Macromedia Flash - RGB color slider

Step 11

Press F8 again to move the horizontal slider to Button.

images 10 of Macromedia Flash - RGB color slider
Images 10 of Macromedia Flash - RGB color slider

Step 12

When the horizontal slider is still selected, go to the Properties Panel and enter RedControlBarBtn

images 11 of Macromedia Flash - RGB color slider
Images 11 of Macromedia Flash - RGB color slider

Step 13

Take the Selection Tool (V) click once on the button (Button) you just created, go to the Action Script Panel (F9) and enter the following code:

on ( press ) {
startDrag ( this , false , left, top, right, bottom)
}
on ( release ) {
stopDrag ();
}

Step 14

Return to the main scene (Scene 1)

images 12 of Macromedia Flash - RGB color slider
Images 12 of Macromedia Flash - RGB color slider

Step 15

Using the Text Tool (A), go to the Properties Panel and select the properties below:

- Choose Dynamic Text . You need to select this type of text because it can be changed via ActionScript.

- Select Arial font, bold type ( B )

- Choose font size 12

- Text color is black.

- The rendering option is Bitmap text (no anti-alias)

images 13 of Macromedia Flash - RGB color slider
Images 13 of Macromedia Flash - RGB color slider

Then click and drag a text field below the slider. See the picture below.

images 14 of Macromedia Flash - RGB color slider
Images 14 of Macromedia Flash - RGB color slider

Step 16

In the Properties Panel , in the Var section enter redRGB

images 15 of Macromedia Flash - RGB color slider
Images 15 of Macromedia Flash - RGB color slider

So we have completed the first slider ( Red ). Repeat the steps above to create the Green and Blue colored bars according to the respective steps.

images 16 of Macromedia Flash - RGB color slider
Images 16 of Macromedia Flash - RGB color slider

Step 17

Using the Oval Tool (0), select no color for the Stroke color , and choose any color in the Fill color field and draw a circle with a size of 230 x 230px

images 17 of Macromedia Flash - RGB color slider
Images 17 of Macromedia Flash - RGB color slider

images 18 of Macromedia Flash - RGB color slider
Images 18 of Macromedia Flash - RGB color slider

Step 18

Select the drawn circle, press F8 key ( Convert to Symbol ) to convert it into a Movie Clip Symbol.

images 19 of Macromedia Flash - RGB color slider
Images 19 of Macromedia Flash - RGB color slider

Step 19

While still selecting the newly created Movie Clip (circle), go to the Properties Panel and enter circle into the section

images 20 of Macromedia Flash - RGB color slider
Images 20 of Macromedia Flash - RGB color slider

Step 20

Now create a control point: select the Oval Tool (O), choose the Stroke color without color, Fill color choose any color and draw a 5 x 5px circle.

images 21 of Macromedia Flash - RGB color slider
Images 21 of Macromedia Flash - RGB color slider

Step 21

When the control point is still selected, press F8 key and convert it into a Movie Clip Symbol

images 22 of Macromedia Flash - RGB color slider
Images 22 of Macromedia Flash - RGB color slider

Step 22

Go to the Properties Panel of the control point, at the part and enter ControlPoint .

images 23 of Macromedia Flash - RGB color slider
Images 23 of Macromedia Flash - RGB color slider

Step 23

Pick the Selection Tool (V), click on the control point, go to the Properties Panel again. On the right side you will see the Color menu section. Select Alpha and 0% .

images 24 of Macromedia Flash - RGB color slider
Images 24 of Macromedia Flash - RGB color slider

Step 24

onClipEvent ( enterFrame ) {
_parent .redRGB = ( _parent .RedSlider.RedControlBar. _y +122) .toString (16);
if ( length ( _parent .redRGB) == 1)
_parent .redRGB = "0" + _parent .redRGB;
_parent .greenRGB = ( _parent .GreenSlider.GreenControlBar. _y +122) .toString (16);
if ( length ( _parent .greenRGB) == 1)
_parent .greenRGB = "0" + _parent .greenRGB;
_parent .blueRGB = ( _parent .BlueSlider.BlueControlBar. _y +122) .toString (16);
if (length ( _parent .blueRGB) == 1)
_parent .blueRGB = "0" + _parent .blueRGB;
finalColor = "0x" + _parent .redRGB + _parent .greenRGB + _parent .blueRGB;
_parent .circleColor. setRGB (finalColor);
_parent .circleColor. setRGB (finalColor);
}

Step 25

Create a new layer and name it action. Select the first frame, go to the Action Script Panel (F9), enter the following code:

circleColor = new Color (circle);

And finally test the product (Ctrl + Enter).

5 | 2 Vote
« PREV : Macromedia Flash -...
Macromedia Flash -... : NEXT »