MACROMEDIA FLASH MX 2004-USING ACTIONSCRIPT IN FLASH Use Manual page 187

Using actionscript in flash
Hide thumbs Also See for FLASH MX 2004-USING ACTIONSCRIPT IN FLASH:
Table of Contents

Advertisement

display_txt.text = "Right";
} else if (Key.isDown(Key.UP)) {
this._y = Math.max(this._y-distance, 0);
display_txt.text = "Up";
} else if (Key.isDown(Key.DOWN)) {
this._y = Math.min(this._y+distance, 400-this._height);
display_txt.text = "Down";
}
};
Select Control > Test Movie to test the file.
8.
For more information about the methods of the Color class, see the Color class entry in
ActionScript Dictionary Help. For more information about the methods of the Key class, see the
Key class entry in ActionScript Dictionary Help.
Setting color values
You can use the methods of the built-in Color class to adjust the color of a movie clip. The
method assigns hexadecimal red, green, blue (RGB) values to the movie clip. The
setRGB()
following example uses
A button action creates a Color object and changes the color of the car based on user input.
To set the color value of a movie clip:
Select a movie clip on the Stage.
1.
In the Property inspector, enter
2.
Create a button named colorChip, place four instances of the button on the Stage, and name
3.
them red_btn, green_btn, blue_btn, and black_btn.
Select Frame 1 in the main Timeline, and select Window > Development Panels > Actions.
4.
to change an object's color based on user input.
setRGB()
carColor
as the instance name.
Creating interactivity and visual effects
187

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents