I’m using the following method to dispatch a sound in X times/minute (X is determined through bpm, which is a NumericStepper object)
var mainTimer:Timer = new Timer(60 / (bpm.value * 1000),0);
mainTimer.addEventListener(TimerEvent.TIMER, fl_TimerHandler,false, 0, true);
mainTimer.start();
function fl_TimerHandler(event:TimerEvent):void
{
metroTransform.volume = vol;
flash.media.SoundMixer.soundTransform = metroTransform;
metroChannel = metro.play();
mainTimer.delay = 60 / bpm.value * 1000;
}
According to this http://www.metronomeonline.com/ the sound is not sitting well. Is there something I can do to fix this problem I’m stuck in?
Path to the output file I’m getting: http://conatur.net/metroBig.swf
http://cookbooks.adobe.com/post_Accurate_timer-17332.html might help you.