Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-22-2009, 07:57 PM   #1
adamvan101
Member
 
Join Date: Jul 2009
Posts: 40
Default [AS2] money system that follows

Hey,
i need help with a money system that acts as a score does. on the top of the screen is a MC box and within the MC are two text boxes, one says "money: $" and the other has instance name money_value. I have a global variable set money and it starts at 0. Now, this is an adventure/shooter so the screen moves and follows the main character. so does the MC box. how can i update the 0 to change when the money goes up?
thanks,
adamvan101
adamvan101 is offline   Reply With Quote
Old 07-22-2009, 08:23 PM   #2
dplows
</war><peace>
 
dplows's Avatar
 
Join Date: Jun 2009
Location: NY
Posts: 256
Default

SCORE:
Create a dynamic text box with the variable (Properties panel) "score".
Convert it to a movie clip symbol with an instance name "scorer".
On the movie clip:
Code:
onClipEvent(load){
     score=0;
}
Wherever you want to add score (I'll use a button example):
Code:
on(press){
     _root.scorer.score+=5;
}
That's it! Be creative.
dplows is offline   Reply With Quote
Old 07-22-2009, 11:14 PM   #3
adamvan101
Member
 
Join Date: Jul 2009
Posts: 40
Default

So the textbox can be a MC and it will still work? i just put that code right in the MC?
adamvan101 is offline   Reply With Quote
Old 07-26-2009, 01:16 AM   #4
adamvan101
Member
 
Join Date: Jul 2009
Posts: 40
Default

sorry, never mind. i got it thanks to your code - i just had to change things around a little
adamvan101 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:52 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.