Adding Hotspot
Adding Hotspot
Make instances of the circle button and put 1 instance on top of each color in the color
wheel.
In the Properties panel, make the instance name of each circle the name of the color plus
“_btn”. Eg: yelloworange_btn
7. Make hotspots.
To do this, double - click on any of the circles with the Selection Tool and it
take you in symbol – editing mode. You will see the button timeline that
includes the 4 states: up, over, down and hit. To make the button a hotspot,
click and drag the shaded circle under the UP state and drop it in the HIT
state so that the hit state is the only state that contains an object. On the
upper left side of the document, click on Scene 1 to return to the main
timeline. You will notice that the fill color of your button will change from
black to a translucent sky blue.
8. Enter the codes.
To do this, click on yellow_mc and press F9 (Actions panel shortcut). Then
type the following codes in the Actions panel. the codes will be explained
later:
9.Explaining the codes.
The on(rollOver) handler executes the statements inside it when the user hovers the mouse
pointer over the object where this code is placed.
var colorful creates a new color object named colorful. The statement new
Color("_root.background_mc") says that the color object created (colorful) will be based on
the movie clip called background_mc.
The statement colorful.setRGB(0xffff00) gives a color value to colorful. And
because colorful is referring to the background_mc movie clip, background_mc will change
color based on the hexadecimal value inside the setRGB() function.
The on(rollOut) handler executes the statements inside it when the user hovers the mouse
pointer outside the space taken up by the object where this code is placed.
10. Copy the codes to the rest of the hotspots.
The codes will still be the same, however, the hexadecimal value for the first setRGB() function should
change:
- Be guided by the following hexadecimal values for the different colors used in the color wheel:
Yellow: 0xFFFF00
Yellow Orange: 0xFEBF00
Orange: 0xFE8F01
Red Orange: 0xFE6A00
Red: 0xFE0000
Red Violet: 0xD000DA
Violet: 0xAE00FF
Blue Violet: 0x8C00FF
Blue: 0x0000FE
Blue Green: 0x00B5B8
Green: 0x00FF00
Yellow Green: 0xACFF00
NOTE: the hexadecimal value in the setRGB() function found in the on(rollOut) handler should be fixed
because whenever the mouse pointer does not point on any color in the color wheel then the background should remain white in
color so as not to confuse the user.
11. Save your file.
To save your Flash file, click on File ► Save As
Shortcut: Ctrl + Shift + S