Graphics Programs Reference
In-Depth Information
Step 10: Create the scrolling functions
The functions for scrolling are provided below. The scrolling functions are quite similar
to panning except for setting the upper and lower bounds. These bounds prevent the
panorama from scrolling off the Stage, either from above or from below. When the
panorama reaches either of these limits, it can go no farther.
Add these functions after those for panning. You can delete the dontMove() handler,
as we will be replacing its functionality with a new set of cursors.
66
67
68
69
70
71
72
73
74
75
76
77
scrollDown = function ()
{
pano_mc._y += ymoveAmount;
if (pano_mc._y > ymax){ pano_mc._y = ymax }
}
scrollUp = function ()
{
pano_mc._y -= ymoveAmount;
if (pano_mc._y < ymin){ pano_mc._y = ymin }
}
Save and test your movie. Although there are currently no cursors, you should be able
to pan and scroll in all directions.
Step 11: Create additional cursors
Since we now have a wider range of motion, we should have cursors that include both
vertical and diagonal movement. To do this we will actually need a set of nine cursors
as shown in Figure 8.15.
Choose File > Import > Import to Library. Locate the folder named CursorSet in the
Chapter 8 folder, Shift-select the cursors provided, and import them. The cursors rep-
resent the general directions in which we will want to move the mouse: the four primary
movements of left, right, up, and down, plus the four diagonal movements, and one
cursor for no movement.
Search WWH ::




Custom Search