Hi guys.
need a big little help on how could i record the precise time(in milliseconds) where sound effects are being played. This is what i have in mind/ or what i have done so far as an example:
[LIST=1]
[]i start clicking the ‘record button’ and the timer starts.
[]Then i play a sound effect and the time elapsed is 1.444 seconds,
[*]after that i stop the recording.
[/LIST]
What i was doing is push the values of the timer elapsed into an array as a string. So when i hit the ‘play recorded clip’ button, the timer starts again but this time:
[LIST=1]
[]it is constantly checking for the timer
[]On the example i have stated above; when the time elapsed at 1.444 seconds, i expect the sound i’ve played when i recorded to play.
[/LIST]
I have the methods needed to fire away the specific sound effect. The one thing i need help though is how could i achieve this in a better way? Coz what i’m doing right now doesn’t seem to work.
What i do is this:
// i have placed the timer elapsed in a var
// this code is inside an ENTER_FRAME listener
var timeElapsed = getTimer();
if(timeElapsed == 'storedTimeArray[0]');
{
//basically, i'm going to call the method to play the sound effect.
}