• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

On Your Own

To complete the assignment of behaviors to the navigational elements you've placed on the stage, create new behaviors for the 8:BiographyDim, 6:QuestionDim, and 10:EXITDim sprites. This gives you more practice using the Behavior Inspector to create similar behaviors.

You may be wondering why you are creating a separate behavior for each of the menu items. You probably remember from Lesson 9 that it is possible to use a single behavior and set the parameters for each sprite to which the behavior is attached. The behavior used in Lesson 9, the Turn Towards Mouse behavior, was taken from the Library Palette and was written in an object-oriented manner, which allows for unique sprite properties. Behaviors created with the Behavior Inspector are written in a much simpler style and don't have this capability. The advantage of using the Behavior Inspector is that the behaviors are easily modifiable, and in the next lesson, you will add a Mouse Up action to the behaviors to provide navigation. On the other hand, you could use a behavior from the Library Palette for both the changing of the sprite and the navigation, for a total of two behaviors. So which way do you go? Unfortunately, there is no hard and fast rule. Behaviors from the Library Palette are much larger and generally require extensive knowledge of Lingo to modify, but may provide additional functionality. Behaviors created in the Behavior Inspector are smaller—the ones you just created are each only six lines—and can be modified with only a basic understanding of Lingo.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint