Director Tutorial 7- Navigating Using Relative Markers

Up to now we have been navigating through our movie by specifying a frame to jump in a "go to frame" script. This is very efficient method of coding for buttons with a specific destination like "quit" or "main menu". What about the "BACK" and "NEXT" buttons on the bottom of every page? The same button may have 10 different destinations during our movie.

Figure 7.1: The Navigation Bar

One solution would be to write 10 different scripts to handle each link, a very time consuming process and will result in a movie with a larger file size.

Another solution is navigating to relative markers. From Figure 7.2, the playback head is stationary in frame 209 which is labelled"Department Details". As far as lingo is concerned we can refer to this frame in two ways:

  • Frame "Department Details"
  • Marker (0)

It is called marker (0) because it is the marker closest the the playback head on it's left side including directly above the playback head If no marker existed in frame 209 then marker (0) would be the marker labelled"Company Details", i.e. the next marker to the left on the playback head's current position.

Markers to the left of the playback head are considered negative markers, they will begin at 0, the next marker will be marker(-1), the next marker would then be marker (-2) and so on.

Markers to the right of the playback head are considered positive markers. These markers begin with marker(1), then marker (2) and so on.


Figure 7.2: Markers Relative to the playback head Position

This allows us to write a single script for each of our navigation buttons.

The BACK button will have the following script:

on mouseUp

go to marker(0)

end

 

The FORWARD button will have the following code:

on mouseUp

go to marker(1)

end

 

If you haven't already coded the main menu button:

on mouseUp

go to frame "main menu"

end

 

Figure 7.3: The Project so far

In this tutorial you have learned how to:

  • Use a single line of code to navigate back and forth throughout your movie

Click here for the .DIR for this tutorial

Back to director tutorials