Untitled

 avatar
unknown
plain_text
a year ago
3.2 kB
3
Indexable
stop();

import flash.events.MouseEvent;
import flash.media.Sound;
import flash.media.SoundChannel;

var soundChannel:SoundChannel; 
var yourSoundInstance:Sound; 

Indonesia.addEventListener(MouseEvent.CLICK, onCountryClick);
Malaysia.addEventListener(MouseEvent.CLICK, onCountryClick);
Singapura.addEventListener(MouseEvent.CLICK, onCountryClick);
Thailand.addEventListener(MouseEvent.CLICK, onCountryClick);
Filipina.addEventListener(MouseEvent.CLICK, onCountryClick);
Vietnam.addEventListener(MouseEvent.CLICK, onCountryClick);
Laos.addEventListener(MouseEvent.CLICK, onCountryClick);
Myanmar.addEventListener(MouseEvent.CLICK, onCountryClick);
Kamboja.addEventListener(MouseEvent.CLICK, onCountryClick);
Timor.addEventListener(MouseEvent.CLICK, onCountryClick);
Brunei.addEventListener(MouseEvent.CLICK, onCountryClick);
mpi.click("homeBtn", 1);

function onCountryClick(event:MouseEvent):void {
  
    switch (event.currentTarget.name) {
        case "Indonesia":
          
            stopSound();
			gotoAndStop(14);
        
            yourSoundInstance = new YourSound(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Malaysia" :
			stopSound();
			gotoAndStop(24);
        
            yourSoundInstance = new LAGUMALAYSIAA(); 
            soundChannel = yourSoundInstance.play();
            break;	
		case "Singapura" :
			stopSound();
			gotoAndStop(34);
        
            yourSoundInstance = new SINGAPURALAGU(); 
            soundChannel = yourSoundInstance.play();
            break;	
		case "Thailand" :
			stopSound();
			gotoAndStop(44);
        
            yourSoundInstance = new LAGUTHAILANDS(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Filipina" :
			stopSound();
			gotoAndStop(54);
        
            yourSoundInstance = new FILIPIN(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Vietnam" :
			stopSound();
			gotoAndStop(64);
        
            yourSoundInstance = new VIETNAMS(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Laos" :
			stopSound();
			gotoAndStop(74);
        
            yourSoundInstance = new LAGULAOZ(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Myanmar" :
			stopSound();
			gotoAndStop(84);
        
            yourSoundInstance = new MYANMARSONG(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Kamboja" :
			stopSound();
			gotoAndStop(94);
        
            yourSoundInstance = new SONGKAMBOJA(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Timor" :
			stopSound();
			gotoAndStop(104);
        
            yourSoundInstance = new SONGTIMOR(); 
            soundChannel = yourSoundInstance.play();
            break;
		case "Brunei" :
			stopSound();
			gotoAndStop(114);
        
            yourSoundInstance = new SONGBRUNEI(); 
            soundChannel = yourSoundInstance.play();
            break;
    }
}

function stopSound():void {
    if (soundChannel && soundChannel.position > 0) {
        soundChannel.stop();
        soundChannel = null; 
        yourSoundInstance = null;
    }
}
Editor is loading...
Leave a Comment