» Home » Movies » Tutorials » Submissions » Sound FX » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops
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) {
_root.money+=10;
}
```

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)

## HAPPY FLASHING!!!!

Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops

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

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.