A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


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

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


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

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


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: 281
» 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
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs