First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Sanova
Bring up your file from the last tutorial. Add a layer in your main timeline. Name that layer 'Script'.(without the quotes) In that layer's actions put:

Health = 100;
Money = 100;

This basically means that Health is 100 and Money is 100. These are variables. Variables are meant to be changed or altered for your needs. Let's take for example, time and distance. In the real world this is the most common (I think). So let's say you're riding your bike in the Street. The street is 2 mi long and you want to ride across it and back. Your total distance is, you guessed it, 4 mi. Now, you've gone 1 mi in 5 min. If you were to take a break at 3 mi and speed up until you got back to where you started (4 mi.), then your total time would be about 15 minutes. (it's kinda hard to explain so try to follow along as best as you can.) Your time changed through out your little ride. As well as your distance. The best way to represent this would be in a graph:

As you can see, the place where you took a break will show no progress.

Now let's alter the variables in our little project. Make a button by drawing a circle and rightClick-Convert to symbol. Change the type of symbol to a button. (just name it 'button') And click 'OK' Now you have a button! Now in the button's actions, add these actions:

on (release) {;

If you were to test the movie, nothing would happen(that you can see). Too see this change, add a text box, and make it a dynamic textbox. Make its variable name: 'money'. Now if you test your movie(Ctrl+Enter), if you press your button, the counter would go up! You can use what we just did so far to upgrade skills, take money, drink stuff, etc. If these tutorial seems incomplete, I hope to cover it more in the second tutorial. This may not have been very helpful to you in some ways. Don't worry in the next tutorial, I will explain how to use them in other and better ways. (I'll also explain what to do with the Health Variable)


also, you can contact me at for questions and personnal comments


» Level Intermediate

Added: 2005-09-28
Rating: 6 Votes: 3
(10 being the highest)
» Author
Not much to say except that I LOVE FlashMX!
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.