Graphics Programs Reference
In-Depth Information
Since the panorama will be moving, we'll use an onEnterFrame handler to describe its
behavior. A custom cursor movie clip is repositioned to the cursor's current position.
If the mouse button is pressed, a function checkTheMouse is called to load the correct
cursor graphic (Figure 11.29). This reinforces the movement of the panoramic image.
For more detail on this function refer to Chapter 8—specifically Exercise 8.4.
38
39
40
41
42
43
44
45
pano_mc.onEnterFrame = function() {
cursor_mc._x = _xmouse; // set the cursor location
cursor_mc._y = _ymouse; // to the mouse location
if (pressed) { checkTheMouse(); }
else cursor_mc.gotoAndStop(10);
};
Figure 11.29 Custom cursor
The last bit of code rotates the compass pointer to reflect the direction you are moving.
The compass is a movie clip. Inside the movie clip is a pointer movie clip with the regis-
tration point set at the bottom (Figure 11.30).
Figure 11.30 Compass movie clip
Search WWH ::




Custom Search