Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories Makin a RPG: Part 2 - Working with Variables
Author: Sanova

 
Page 2
«prev 1 2

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)

THE NEXT TUTORIAL: HOTSPOTS AND HITTESTS!!!!

also, you can contact me at j.j.lynn@verizon.net for questions and personnal comments

HAPPY FLASHING!!!!

«prev 1 2

» Level Intermediate

Added: : 2005-09-28
Rating: 6.33 Votes: 3
Hits: 285
» Author
Not much to say except that I LOVE FlashMX!
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments