// Frame #1 code - ActionScript 3.0 and Flash CS3 (Flash 9.0)
stop();
var snd:Sound = new Sound();
snd.load(new URLRequest("ghostbusters.mp3"));
snd.addEventListener(Event.COMPLETE, onSoundLoaded);
var channel:SoundChannel = new SoundChannel();
this.addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
function onLoop(evt:Event):void {
/*lPeak.height = 100 * channel.leftPeak + 50;
rPeak.height = 100 * channel.rightPeak + 50;*/
lPeak.scaleY = 1 + 5 * channel.leftPeak;
rPeak.scaleY = 1 + 5 * channel.rightPeak;
lPeak.alpha = 0.3 + channel.leftPeak / 1.4;
rPeak.alpha = 0.3 + channel.rightPeak / 1.4;
}
whoYaGonnaCall_btn.addEventListener(MouseEvent.CLICK, playGB);
function playGB(evt:MouseEvent):void {
channel.stop();
lPeak.alpha = 0;
rPeak.alpha = 0;
gotoAndStop(20);
}
function onSoundLoaded(eventObj:Object):void {
channel = snd.play();
}
Ghostbusters soundtrack slice mp3 audio
file.
// Frame #20 (KF #2) code - ActionScript 3.0 and Flash 9 (CS3)
repeat_btn.addEventListener(MouseEvent.CLICK, goToStart);
function goToStart(evt:MouseEvent):void {
lPeak.alpha = 1;
rPeak.alpha = 1;
gotoAndStop(1);
}