Developing Webs logo
Google
Web DW-Main DW-Photoshop
Visit the message board for solutions or post a question Check out the Classes offered for free at Developing Webs Voice Chat submit a tutorial, resources, article, font for publication consideration and earn a one way link back to your site Get more specifics about the Developing Webs Voice chat room and its room members View the current news at Developing Webs alternative sites which are resources for your d3evelopment needs Join Developing Webs Chat Link to us on your web page to help support this resource! Check out Developing Webs At yahoo groups! Developing Webs Home Adobe Photoshop Tutorials Macromedia Flash Tutorials Jasc Paint Shop Pro Tutorials Adobe Illustrator Animation basics Some Basic PHP tutorials Perl Tutorials HTML Tutorials Cascading Style Sheets javascript Front Page Tutorials Macromedia Dream Weaver Tutorials dreamweaver Publishing your site, FTP, ChMod, Promotions
RSS Newsfeed
for your site
DW News
Calendar
DW Forum
Right click on button and copy shortcut

Add to My Yahoo!

Reminder
Remember to book mark this site!



Request a Tutorial

Coin Project 5: Creating an On Click Event That Adds to Score

  • This tutorial is part 5 in a series coin tutorials starting with this tutorial

1. Open your coin movie. We no longer need the text boxes to monitor the Ruby and Mania variables. Lock all layers but your text layer. Use the arrow tool to highlight the contents of the text layer and delete it off the stage.

2.  Select the type tool. Click on the stage and type in the word SCORE. Select the move tool and set the type to static, times new rooman, 16 pt, red.

3. Click on the stage to the right of the word score. Type in the number 0000. Select your m ove tool, and adjust your text properties to say Dynamic text, Times New Roman, 16 pt, black. Set the VAR to score. lock your text layer.

4. Click on frame 1. Select your last script on frame 1 in the action panel. We need to initialize the variable score. Click Actions=> variables=> set variable. Set the variable to srore, the value to 0 and check expression.


5. Now to script the score. Unlock your coin layer. Double click on the coin to open the coin1 movie. On the coin1 movie clip timeline, click on the coin button. Now to add a script to the button. Open the action panel. Click action=>variables=> set variable. The cariable is on the main stage so in the variable field we type the path to the variable <dot> variable.or _root.score. For the value, type in the previous value for score, and add 1, or _root.score + 1. Check expression.

6. Test your  movie. Clicking the coin will now change the score in the score box by increasing the value by 1 with each click.

Next tutorial will show you how to make your movie clip change appearance when you click it.



"Building The Web Into a Nicer Place -- One Site At A Time"
Developing Webs Group Copyright © 2001-2026 All Rights Reserved
Privacy and Legal