Hey everybody! The following code works exactly like I want it to by turning on the sound for my flash movie, but once the sound is on I can't figure out how to make the same button turn it off again. Can someone help me?
Code:import flash.media.Sound; import flash.media.SoundChannel; status.text = "Chimes Off"; playButton.addEventListener(MouseEvent.MOUSE_DOWN, playChimes); function playChimes(e:MouseEvent):void { var chimes:Chimes = new Chimes(); var chimesSound:SoundChannel = chimes.play(); status.text = "Chimes On"; var chimesStatus:Boolean = true; trace ("Playing!"); }




Reply With Quote