|
Back to DEB Tips
Flash 5: The
Color Object
Give your visitors the option to control
the color in your Flash movies by using the Color Object.
An object is a piece of data (color, sound, movie, etc.) that
contains a set of methods (the things that objects do).
1. First, create a movie clip that contains
the object for which you'd like to change the color.
2. Next, drag an instance of the movie clip
onto the Stage and choose Modify...Instance. Name the instance.
3. Create a button symbol. This button will
be used to call upon the movie clip and change its color.
4. Drag an instance of the button symbol,
select the button symbol on the Stage and choose Window...Actions.
5. First we need to instantiate the object.
Choose Actions...Set Variable to create a name for the object,
and to call upon the New Color method. In the Variable field,
type the name of the Color object: myColorObject. In the Value
field, choose Objects...Color...New Color. With the "target"
highlighted in parentheses, choose the Insert Target Path
button.
6. Control the movie clip by targeting the
movie clip with the Insert Target Path dialogue. The Insert
Target Path dialog box appears, showing the movie clip hierarchy
of the current clip. For the Mode, choose how to display the
hierarchy of the movie clip instance:
Absolute mode
With absolute mode, the main movie's timeline is called
"_root" All other timelines are organized relative
to the" _root" timeline.
Relative mode
With relative mode, the current Timeline is called "this"
All other timelines are relative to the "this" timeline.
7. Choose the movie clip from the Tree view
and click OK
8. Select the Expression checkbox next to
the Value field to remove the quotes around the new Color
method.
9. Choose Actions...Evaluate to begin a
new line of ActionScript
10. In the Expression field, type the name
of the Color Object: myColorObject and then choose Objects...Color...Set
RGB. Highlight the RRGGBB method and create a color from the
Mixer panel. Be sure to set the color mode to HEX on the Mixer's
flyout panel. Use the Mixer panel to obtain the hexadecimal
values for the new color. Type them into the Set RGB method.
11. Choose Control...Test movie to see the
results! When the user presses the button, the movie clip
instance on the Stage changes color!
NOTE: Create several instances of the
button and apply different RGB/HEX values to the Set RGB method
for each button.
Source:
This lesson was developed especially for YOU by Debbie Berg
:-)
WATCH
FOR MORE DEB TIPS TO COME! STOP BY AND SEE MY NEW DEB
TIP EACH MONTH...
Back
to top

about debbie |
debbie's clients | deb's
schedule | deb's monthly tip
flawebdeb home | dreamweaver
| flash | frontpage
| photoshop
web seminar | digital
design camp | dreamweaver/flash
conference

|