Whatever is in the fixed font is taken directly from the lingo scripts.
on QTrollover global qtSprite, remainder, CurFrame, upSprite, up, down, left, right, upleft, upright, downleft, downright, center, horz, vert, incr, pictureThere are 17 global variables in this script. Fifteen of them are initialized in score script 01 and are passed to the lingo script. The other two global variables are calculated within the lingo script.
Quicktime does not number the frames of your movie in the way that you would. Instead, it increments the frame numbers in such a fashion that the increment is equal to 60 divided by the # of Frames per Second. So your array of frames looks like this. The numbers begin with 0 and are referred to in the scripts as the movieTime.
0 1*incr 2*incr 3*incr 4*incr .....................................(N-1)*incr N*incr . . . . . . . . . . . . . M*incr.............................................................................M*N*incrFor each numerical example,we will assume that the following values have been passed from the score script.
set qtSprite = 11 set upSprite = 12 set horz = 11 set vert = 11 set incr = (60/qtFPS) = 2 set up = 2 set down = 8 set left = 4 set right = 6 set center = 5 set upleft = 1 set upright = 3 set downleft = 7 set downright = 9 set picture = 10Each segment of the lingo script is presented and explained:
if rollover(picture) then set CurFrame to the movieTime of sprite qtSprite set remainder to CurFrame mod (horz * incr) set the movieRate of sprite qtSprite to 0 set the movieRate of sprite upSprite to 0 end ifThe function rollover If the mouse is inside the navigation window, then set the variable CurFrame equal to the movieTime of the small movie, set the variable remainder equal to CurFrame mod (N*incr) , and set movieRate of both movies on the screen to stop (0)
Explanation of mod function:
The mod function returns the remainder of one number divided by another. A numerical example follows:
remainder = 100 mod 15; 100/15=6.6666667 or 6 with a remainder of 10 therefore the variable remainder is set equal to 10 remainder = 100 mod 20; 100/20=5 or 5 with remainder of 0 therefore the variable remainder is set equal to 0We are using the mod function to find the remainder of CurFrame divided by (N-1)*incr. The frame, or element in the matrix above, that you are in divided by the number of columns in the matrix. The remainder will determine your location relative to the leftmost and rightmost columns of the matrix.
if rollover(center) then --- center of picture set the movieTime of sprite upSprite to CurFrame end ifIf you are in the center of the navigitable (small) movie then set the CurFrame (current frame) of the large movie to the CurFrame (current frame) of the small movie. This updates the large movie to show the same frame the small movie is currently in.
if rollover(left) then --- left of picture if (remainder = 0) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite = CurFrame - incr end ifIf the remainder (from the mod function) is equal to zero, then you can't go left (you are on the left end (column 0) of the matrix). The mod function is dividing your location in the matrix (CurFrame) by the number of elements in the row. If you are on the left end of the matrix, the remainder will be zero and you cannot go further left. If the remainder is not equal to zero, then subtract the value of incr from CurFrame.
if rollover(right) then --- right of picture if (remainder = ((horz-1)*incr)) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite = CurFrame + incr end ifIf remainder equals (N-1)*incr. (you are on the right end ((N-1)*incr column) of the matrix) then you cannot go right. (See explanation for rollover(left)). If remainder is not equal to zero then the value of incr is added to CurFrame. The reason you use (N-1)*incr is because the first frame is frame 0 not frame 1, so you always have to subtract one incr. See above matrix diagram.
if rollover(up) then --- top of picture if the movieTime of sprite qtSprite > ((horz-1)*incr) then set the movieTime of sprite qtSprite = CurFrame - (horz * incr) else set the movieTime of sprite qtSprite = CurFrame end ifIf movieTime of your.Moov is greater than (N-1)*incr.,then subtract N*incr from CurFrame. Remember that a movieTime of greater than (N-1)*incr means that you are on the second row of the matrix or farther down, so there is room to move up. Else, you are already at the top of the figure so stay where you are.
if rollover(down) then --- bottom of picture if the movieTime of sprite qtSprite > ((((vert-1)*horz)*incr)-incr) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite = CurFrame + (horz * incr) end ifIf movieTime of your.Moov > (M-1)*N*incr you are already on the bottom so stay where you are. Remember that the last element of the second row from the bottom row is (M-1)*N*incr so movieTime greater than that would imply that you are already on the bottom of the matrix. Else, you are not on the bottom row so add N*incr to CurFrame and go down one row.
if rollover(upleft) then --- top left of picture if remainder = 0 or the movieTime of sprite qtSprite <= ((horz-1)*incr) then set the movieTime of sprite qtSprite to CurFrame else set the movieTime of sprite qtSprite to CurFrame - ((horz+1)*incr) end if if rollover(upright) then ---top right of picture if remainder = ((horz-1)*incr) or the movieTime of sprite qtSprite <=((horz1)*incr) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite to CurFrame - ((horz-1)*incr) end ifcheck remainder and current position to see if you can move, if so set movieTime = Curframe - (N-1)*incr
if rollover(downleft) then --- bottom left of picture if (remainder = 0) or the movieTime of sprite qtSprite > ((((vert-1)*horz)*incr)-incr) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite to CurFrame + ((horz-1)*incr) end ifcheck remainder and position to see if you can move, if so set movieTime=CurFrame+((N*incr)-incr)
if rollover(downright) then --- bottom right of picture if (remainder = ((horz-1)*incr)) or the movieTime of sprite qtSprite > ((((vert-1)*horz)*incr)-incr) then set the movieTime of sprite qtSprite = CurFrame else set the movieTime of sprite qtSprite to CurFrame + ((horz+1)*incr) end ifcheck remainder and position to see if you can move, if so set movieTime=CurFrame-((N*incr)+incr)