Hi guys!
Please check this out:
Carl, this may be the timer you were looking for. My question to you is: this a 34 seconds track set to loop, for the moment, and the green time display is what you should be looking for. It now displays the actual time of the track as it plays and resets to zero when re-starting. Is this the time you would like in the case of a track looping, or would you rather want a cumulative time displayed as long as the track is playing?
Wangbar, I've never really liked maths and usually have a hard time with them.
I've written this script (inside a looping mc) to simply convert the seconds (from getTimer()) into a minutes and seconds display (the black one):
_root.tkcount = Math.floor(getTimer()/1000);
if (_root.tkcount>59) {
_root.minutes = int(_root.tkcount/60);
_root.seconds = _root.tkcount-(60*_root.minutes);
if (_root.minutes<10) {
if (_root.seconds<10) {
_root.display = "0"+_root.minutes+":0"+_root.seconds;
} else {
_root.display = "0"+_root.minutes+":"+_root.seconds;
}
} else {
}
} else if (_root.tkcount<10) {
_root.display = "00:0"+_root.tkcount;
} else {
_root.display = "00:"+_root.tkcount;
}
Now it works fine... But is there a better way (more efficient?) to write such a script? And if I was to put in a function, would it be any better in terms of execution?
Thanks,
ldnewbie
Please check this out:
Carl, this may be the timer you were looking for. My question to you is: this a 34 seconds track set to loop, for the moment, and the green time display is what you should be looking for. It now displays the actual time of the track as it plays and resets to zero when re-starting. Is this the time you would like in the case of a track looping, or would you rather want a cumulative time displayed as long as the track is playing?
Wangbar, I've never really liked maths and usually have a hard time with them.
I've written this script (inside a looping mc) to simply convert the seconds (from getTimer()) into a minutes and seconds display (the black one):
_root.tkcount = Math.floor(getTimer()/1000);
if (_root.tkcount>59) {
_root.minutes = int(_root.tkcount/60);
_root.seconds = _root.tkcount-(60*_root.minutes);
if (_root.minutes<10) {
if (_root.seconds<10) {
_root.display = "0"+_root.minutes+":0"+_root.seconds;
} else {
_root.display = "0"+_root.minutes+":"+_root.seconds;
}
} else {
}
} else if (_root.tkcount<10) {
_root.display = "00:0"+_root.tkcount;
} else {
_root.display = "00:"+_root.tkcount;
}
Now it works fine... But is there a better way (more efficient?) to write such a script? And if I was to put in a function, would it be any better in terms of execution?
Thanks,