Graphics Programs Reference
In-Depth Information
Rather than having separate clips for the arrows, let's create a single movie clip to house
them. Choose Insert > New Symbol. Create a movie clip named
cursorMC
with three
frames as shown in Figure 8.14.
Figure 8.14
Creating a cursor movie clip
In frame 1, drag
leftArrowMC
from the Library onto the Stage and center it.
In frame 2, drag
noMoveMC
from the Library onto the Stage and center it.
In frame 3, drag
rightArrowMC
from the Library onto the Stage and center it.
In the
cursors
layer of Scene 1, drag the
cursorMC
clip anywhere onto the Stage
and name its instance
cursor_mc
.
Let's hide the cursor whenever the user enters the panorama and show it when the
user leaves the panorama. Add the lines shown below.
7
8
9
10
11
12
// define the panorama actions
pano_mc.onRollOver = function() { Mouse.hide(); }
pano_mc.onRollOut = function() { Mouse.show(); }
pano_mc.onEnterFrame = function()
{
Step 14: Update the checkTheMouse handler
With the new
cursor_mc
clip, we can make some refinements in our script. The first
thing we need to do is to set the coordinates of the
cursor_mc
to the coordinates of
the cursor. That will guarantee that the arrows will track like the mouse.
Search WWH ::
Custom Search