Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time remaining becomes score

Status
Not open for further replies.

squiggles121

Technical User
Aug 17, 2006
14
GB
Hiya

I want to make a scoreboard for my flash mini game but so that the time remaining becomes the score (so the quicker you do it the more points you get!).

I have created my timer as a movie clip with a dynamic textbox with the variable name timer. This is then dragged onto the main timeline and given the instance name of countdown,

The following code makes it work:


Code:
countdown.onEnterFrame = function() {
	this.timer = int(30-(getTimer()-startTime)/1000);
	if (Number(this.timer) == 0) {
		gotoAndPlay(108);
	}
	timer = 0;
}

Then to freeze the timer on the game over screen i have the code:


Code:
countdown.onEnterFrame = function() {
	stop();
};

I want to somehow put this "frozen" time into a variable which can be sent to the scoreboard. Any ideas on how I could go about doing this?

thanks a lot
 
You could create a dynamic text and put in the VAR form the name of the variable that calculates the score.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top