Timer/Points Help!?
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
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**
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
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
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
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?
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
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
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
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
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
Yes! Everythings perfect now, but the stupid mouse effect thing, its an animation and I guess the timer is counting that too. Any fixes?
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
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?
- Rustygames
-
Rustygames
- Member since: May. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
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 correctNo, not the Instance Name. The var for the textbox
Old school
- Matt, Rustyarcade.com
- MilkMan268
-
MilkMan268
- Member since: Oct. 14, 2007
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
Maybe something like, start that script on frame 2?


