USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 3/18/09 05:41 PM
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**
Posted at: 3/18/09 05:44 PM
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
Main timeline:
cnt=0;targ=30;score=0 onEnterFrame=function(){ cnt++; if(cnt>=targ){ score+=1;cnt=0; } }
Untested
- - Flash - Music - Images - -
Posted at: 3/18/09 05:51 PM
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?
Posted at: 3/18/09 05:54 PM
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
Posted at: 3/18/09 06:20 PM
Dosen't seem to work, I did everything right. The instance I put as score? Isn't that correct
Posted at: 3/18/09 06:27 PM
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
Posted at: 3/18/09 07:02 PM
Yes! Everythings perfect now, but the stupid mouse effect thing, its an animation and I guess the timer is counting that too. Any fixes?
Posted at: 3/18/09 07:11 PM
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?
Posted at: 3/18/09 07:40 PM
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 correctNo, not the Instance Name. The var for the textbox
Old school
- Matt, Rustyarcade.com
Posted at: 3/18/09 08:11 PM
Maybe something like, start that script on frame 2?
All times are Eastern Standard Time (GMT -5) | Current Time: 08:38 PM
<< Back