First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: edmarriner | Website:
Variables What YOU need to know Part 1 If you are serious about making games in flash you NEED to know about variables. Variables have been use in almost every great game there has ever been! There used for things like money , lives , objects and LOADS more things to. So hopefully by the time you’ve read this tutorial you will know the basic’s of variables ! ------------------------ So in the first tutorial (this one) were going to make a money system ! (note: im working in flash mx 2004 pro , although this should work also with flash 5 , mx , mx 2004) Ok , so open up flash if you haven’t all ready. Make a new normal flash file. In the first key frame add this actionscript ; Money = 1000 This tells flash to set the Variable “money” which you just created to 1000. a Variable can be called anything and can hold letters and numbers . In this case its holing numbers. Now make a second layer and call it text . Then rename the other layer to shop. Click on frame 1 of layer text and make a dynamic textbox. On the text boxes properties were it says “ var: “ in the text box to the right type in money. This tells flash to show what ever the Variable money is holding in that text box. If you test the movie now the text box should say “1000”. Now make a button on the layer shop . Give the button this actionscript: on (release) { money -= 10; } Now test the movie again. When you press the button your money gos down 10 each time. You can also use thisaction script on the button; on (release) { money += 10; } This adds 10 to your money ! So how could you this what you have just learnt? Here just two ways; 1) make a shop 2) when you work at a shop you get paid i hop this was helpful and clear. ANY problems just email me at Thanks ed
» Level Intermediate

Added: 2005-01-03
Rating: 6.98 Votes: 44
(10 being the highest)
» Author
im 12 , live in england :)
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • Mr.

    Posted by Brian on 08/13/2012 10:53am

    Hey, man, this was pretty good, taught me a lot. I'm curious, though, how do you keep the "money" counter from going below zero?

  • 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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.