I'm trying to play a sound effect by calling a function from an onStart parameter of TweenMax. I wanted the sound to play on every timeline.append I listed but it only play once. Code goes:
private var sound:MP3Loader;
...
sound = new MP3Loader("audio/on.mp3", {name:"flare", autoPlay:false, estimatedBytes:12000});
...
timeline.append(new TweenMax(CD["faceplate"], 0.25, {alpha:.5, rotationX:0, onStart:toggleSound}));
timeline.append(new TweenMax(CD["eye_socket"], 0.25, {alpha:0.6,rotationX:0, y:CDy["eye_socket"], onStart:toggleSound}));
timeline.append(new TweenMax(CD["tab_right"], 0.45, {alpha:0.6,y:CDy["tab_right"], ease:Bounce.easeInOut, onStart:toggleSound}), -.25);
timeline.append(new TweenMax(CD["tab_left"], 0.45, {alpha:0.6,y:CDy["tab_left"], ease:Bounce.easeInOut, onStart:toggleSound}), -.25);
...
private function toggleSound():void {
sound.playSound();
}
I might be missing something here so any help will be appreciated. Thanks in advance!
Gerry