Multimedia Production Tools

Our First Lingo Script
The ClickOn

  1. Using the Tool Palette draw a colored ball and place in the center of the screen. Hold down the 'Shift' key to make an exact circle. Copy this colored ball in the score and paste a copy in sprite channels 2 and 3.

  2. Select the ball 1 in channel 1 and set a foreground color using the Tools Palette. Next, color the balls in channels 2 and 3.

  3. Make a new text field. Pull down the Windows menu and select Field (Command-8). Add a new field by clicking on the plus button in the upper left-hand corner.

  4. Name this new text field "my number". Place this text field in channel 4 under the three balls.

  5. Double-click on the sprite (red ball) in channel 1 in the score. Click on the script button on the right side of the dialog box. This brings up the "on mouseUp" filled into a script box.

  6. Type the word "beep" so that every time you click on the ball in channel 1 it beeps.

  7. Repeat for channels 2 and 3. Notice that if you copied the ball into each sprite channel and changed its color in the script, the script is copied also.

  8. Next, select the score script channel (above channel 1) and click in the gray script box in the top of the score window. This brings up the "on exitFrame" filled into a script box.

  9. Type in "go to the frame".

  10. Test movie by running it and clicking on three balls. Make sure each one beeps when clicked on.

  11. Select the script in the script channel in frame 1. (It should say "on exitFrame, go to the frame, etc."

  12. Before "go to the frame" insert a line and type "put the clickOn". This put the number of the sprite channel which has been clicked on into the message box. Test this now by running the movie with the Message window open. (Under the Windows pull-down menu.)

  13. Now add to this same script "put the clickOn into field "my number". This will place the number of the sprite channel which has been clicked on into the text field you made and put in the center of the screen under the three balls.

  14. Test this by running the program.


 



| Home | Site Map | Email Us | Free Downloads |


Click below to jump to another page.




© 2008 The Multimedia Library