Time for action - show TOC

Next, we will programmatically show the table of contents.

  1. Select the Dog-TOC sprite from the sprites list.
  2. From the Control palette, drag the when I receive enter dog block to the scripts area and select show TOC.
  3. From the Looks palette, add the show block to the script.
  4. Double-click on the script to make the Dog-TOC sprite appear. The only item on the stage will be the Dog button.
  5. Click the Dog menu to play the dog scene.
  6. Now click on the Home button. Oops! We forgot a script. Let's add a Control block to display the Home button when we click on Dog in the table of contents.
  7. From the sprites list, select Home.
  8. From the Control palette, add the when I receive enter dog block to the scripts area.
  9. From the Looks palette, add the show block.
  10. Double-click the script to display the Home sprite.
Time for action - show TOC

You can play the scene over and over again by alternatively clicking on the Dog and Home buttons.

What just happened?

We completed the work to let the user flip between the table of contents and a chapter in the book. The concept was straightforward. We displayed and hid sprites based on what the user clicked.

Have a go hero

Finish the task. Display the remainder of the sprites on the table of contents when the user clicks the Home button.

Build sequence

Whether we guide the user through the project or make it interactive, we need to think about the question, "What happens when ... ?" The answer to this question becomes the basis for how we move our users through the project.

In Chapter 4, we built projects that progressed through a series of steps. In essence, we started with an action and just kept adding to it. The user didn't have to be involved.

In this chapter, we created a project that allowed the user to choose a path.

Have a go hero

The horse deserves to tell its joke, too. Create the sequences to hide and display the horse scene.

Next steps

There seems to be a near infinite number of ways in which you can adapt this project. You could create a chapbook to share your poems, or you could create a book for your child that teaches them their ABCs. Do you want to make the scenes more dynamic and action-filled? Add multiple actors to a single screen and have them carry on a conversation.

Mix in music that plays during the transitions, or narrate your own story using the built-in record function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.96.188