PDA

View Full Version : [AS2] money system that follows


adamvan101
07-22-2009, 07:57 PM
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

dplows
07-22-2009, 08:23 PM
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:

onClipEvent(load){
score=0;
}

Wherever you want to add score (I'll use a button example):

on(press){
_root.scorer.score+=5;
}

That's it! Be creative.

adamvan101
07-22-2009, 11:14 PM
So the textbox can be a MC and it will still work? i just put that code right in the MC?

adamvan101
07-26-2009, 01:16 AM
sorry, never mind. i got it thanks to your code - i just had to change things around a little