I have a timer and a dynamic textfield wich displays the time.
Everytime my movieclip hits an enemy I want the timer to add 4 sec. to the current count.
I would like to know why this isn’t working:
timer.currentCount + 4;
(does nothing)
timer.currentCount += 4;
(error: property is read-only)
Am I in the right direction anyway and what should I change?
As stated in the other answer you can’t adjust the elapsed time of your Timer. What you could try to do is create a seperate var you call
var elapsedTime:Number;every time thetimerticks you add 1 to this var. When the hittest occurs you can simply add 4 to it.Because you’re using a var to ‘manipulate’ the the time you don’t need to use the
currentCountanymore. Just refer toelapsedTimein an update function and you’ll be fine.It’ll look like this: