|
|||||
|
| How can I move from page to page (using buttons, shapes, or keys)? | ||||||||||||||||
|
Method 1. Placing a Page Name on a Button:
Method 2. Using a Page Name as a Turtle's Instruction: Right-click on a turtle (wearing any shape) to open its dialog box. For its instruction, write the name of another page. The page will open when this turtle is clicked. See Animated Story 1. Method 3. Using Buttons with an Automated Procedure: Keep the original page names (page1, page2), and use these procedures to move automatically from one page to the next. The procedures are explained below. Place two buttons on each page for navigation. You can name them next and previous or use symbols such as >>> and <<< and then write two more short procedures to define these terms. Vocabulary: ifelse, word, first, pagelist, getpage, bf, first.
The current page is always placed first in the pagelist (the list of all pages in the project). In the pageforward procedure, we tell the computer to compare the first name in the pagelist to the total number of items in the pagelist. If the page number equals the number of items in the list, go back to page1. Otherwise, go to the page ending in a number that is 1 higher than the current page. The pageback procedure tells the computer that if the current page is page1, it should now go to the page ending with the highest number (the number of items in the pagelist). Otherwise, it should go to the page which is one number lower than the current page. The reason we write bf bf bf bf is that we are stripping away the four letters p a g e so that we can look at just the number portion of the page's name. (The descriptions below explain more about these terms, but you can copy and paste these procedures even if you don't quite understand them!) Method 4. Using Arrows:
Method 5. Using Keys: Use the pageforward and pageback procedures above, and add the procedures below to activate pageforward and pageback with keys. See Steering the turtle with keyboard keys for more information. Vocabulary: startup, forever, announce.
|
||||||||||||||||
| « Previous Menu Next » |