sound control

Uploaded over 1 year ago
Uh-oh!

To view swfs on FastSWF, Get Adobe Flash player

sound control

Views: 102
Width: 450
Height: 300

Description:
import flash.media.Sound; import flash.media.SoundChannel; import flash.media.SoundTransform; var snd:Sound; var channel:SoundChannel = new SoundChannel(); var transforms:SoundTransform = new SoundTransform(); transforms.volume = 1; channel.soundTransform = transforms; var arraySound:Array = [new Fat02, new Fat03, new Fat04]; b_play0.addEventListener(MouseEvent.CLICK, playSuara0); b_play1.addEventListener(MouseEvent.CLICK, playSuara1); b_play2.addEventListener(MouseEvent.CLICK, playSuara2); b_stop0.addEventListener(MouseEvent.CLICK, stopSuara); b_stop1.addEventListener(MouseEvent.CLICK, stopSuara); b_stop2.addEventListener(MouseEvent.CLICK, stopSuara); function playYangMana(nomor_array:int) { SoundMixer.stopAll(); snd = arraySound[nomor_array]; channel=snd.play(); } function playSuara0(e:MouseEvent):void { playYangMana(0); } function playSuara1(e:MouseEvent):void { playYangMana(1); } function playSuara2(e:MouseEvent):void { playYangMana(2); } function stopSuara(e:MouseEvent):void { SoundMixer.stopAll(); }