I have the following actionscript which plays an mp3.
var s:Sound = new Sound();
sc = s.play();
I want the alert call to be activated every 100ms during the playback. I have no idea how to do this. I need to add some sort of eventlistener to the playback so that it triggers the alert every 100ms... Any ideas?
ok, half of that was impossible for my pea brain to understand... the other half did not have what i was looking for.
I guess the only solution, which i was trying to avoid is to do a setInterval which will run every 50ms to check the playback position. If the playback position is within certain limits then it will alert the message.
I wish i had found a more intelligent work around though
The first article is a bit complex I understand, but it covers making a class which is then used to provide information about the audio file. Are you planning on streaming this audio? I would think that if you buffer the item it would be fine in most situations, but what are you sending to the alert?
Also there is a .onSoundComplete event which allows you to clear the interval when this occurs, so the alert stops.
jeremy - gnomeontherun Educated questions often get educated answers, and simple questions often get simple answers.
You could use cue points in the audio file (which is the first that I liked to, which is likely the one that caused you some headaches), and here is a great guide to audio (without cues) that I just came across. I just can't find any good resources either for cues besides that one article.