Forum Topic: Timer/Points Help!?

(112 views • 9 replies)

This topic is 1 page long.

<< < > >>
Elated

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 05:41 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

Ok so I want to make a score box ( static text i guess), that after ever 30 frames it adds 1 point to the score box. I have a vague idea of how to do this, but I need some help, anyone? Action Script 2 by the way.

And the movies at 30fps.

And i was thinking could i add some actionscritp on the main timeline every 30 frames, thats like: ...+1..

**Sorry for the other post too**


None

Denvish

Reply To Post Reply & Quote

Posted at: 3/18/09 05:44 PM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,229

At 3/18/09 05:41 PM, MilkMan268 wrote: Ok so I want to make a score box ( static text i guess), that after ever 30 frames it adds 1 point to the score box.

No, dynamic textbox. Var: score

And the movies at 30fps.

Main timeline:

cnt=0;targ=30;score=0
onEnterFrame=function(){
	cnt++;
	if(cnt>=targ){
		score+=1;cnt=0;
	}
}

Untested

- - Flash - Music - Images - -

BBS Signature

None

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 05:51 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

At 3/18/09 05:44 PM, Denvish wrote:
At 3/18/09 05:41 PM, MilkMan268 wrote: Ok so I want to make a score box ( static text i guess), that after ever 30 frames it adds 1 point to the score box.
No, dynamic textbox. Var: score

And the movies at 30fps.
Main timeline:

cnt=0;targ=30;score=0
onEnterFrame=function(){
cnt++;
if(cnt>=targ){
score+=1;cnt=0;
}
}

Untested

So is that place on every 30 frames, or just on the first one?
And what do I put on the first frame to reset the variables?


None

Denvish

Reply To Post Reply & Quote

Posted at: 3/18/09 05:54 PM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,229

At 3/18/09 05:51 PM, MilkMan268 wrote: So is that place on every 30 frames, or just on the first one?
And what do I put on the first frame to reset the variables?

Just the first one
Any time you want to reset the variables, just use the first line of the code I gave

- - Flash - Music - Images - -

BBS Signature

None

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 06:20 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct


None

Denvish

Reply To Post Reply & Quote

Posted at: 3/18/09 06:27 PM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,229

At 3/18/09 06:20 PM, MilkMan268 wrote: Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct

No, not the Instance Name. The var for the textbox

Timer/Points Help!?

- - Flash - Music - Images - -

BBS Signature

None

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 07:02 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

Yes! Everythings perfect now, but the stupid mouse effect thing, its an animation and I guess the timer is counting that too. Any fixes?


Happy

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 07:11 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

Wait, thats one thing but another is how do I get it to stop, but keep the number in the box, so you can enter it into the leaderbaords?


None

Rustygames

Reply To Post Reply & Quote

Posted at: 3/18/09 07:40 PM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,661

At 3/18/09 06:27 PM, Denvish wrote:
At 3/18/09 06:20 PM, MilkMan268 wrote: Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct
No, not the Instance Name. The var for the textbox

Old school

- Matt, Rustyarcade.com


Happy

MilkMan268

Reply To Post Reply & Quote

Posted at: 3/18/09 08:11 PM

MilkMan268 NEUTRAL LEVEL 09

Sign-Up: 10/14/07

Posts: 112

Maybe something like, start that script on frame 2?


All times are Eastern Standard Time (GMT -5) | Current Time: 08:38 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!