home *** CD-ROM | disk | FTP | other *** search
- function initSounds()
- {
- _root.createEmptyMovieClip("soundHolder",25000);
- soundDepth = 0;
- createSound("B_can.wav","B_can_snd");
- createSound("B_extraBall.wav","B_extraBall_snd");
- createSound("B_lose.wav","B_lose_snd");
- createSound("B_stool.wav","B_stool_snd");
- createSound("B_win.wav","B_win_snd");
- createSound("M_ballThud.wav","M_ballThud_snd");
- createSound("M_barrel.wav","M_barrel_snd");
- createSound("M_bumper.wav","M_bumper_snd");
- createSound("M_cart1.wav","M_cart1_snd");
- createSound("M_cart2.wav","M_cart2_snd");
- createSound("M_cart3.wav","M_cart3_snd");
- createSound("M_cart4.wav","M_cart4_snd");
- createSound("M_cart5.wav","M_cart5_snd");
- createSound("M_ding.wav","M_ding_snd");
- createSound("M_flipper.wav","M_flipper_snd");
- createSound("M_horse.wav","M_horse_snd");
- createSound("M_launchNewBall.wav","M_launchNewBall_snd");
- createSound("M_mainRamp.wav","M_mainRamp_snd");
- createSound("M_rampBallKicked.wav","M_rampBallKicked_snd");
- createSound("M_rampThud.wav","M_rampThud_snd");
- createSound("M_saloonDoor.wav","M_saloonDoor_snd");
- createSound("M_scoreTotal.wav","M_scoreTotal_snd");
- createSound("M_scream.wav","M_scream_snd");
- createSound("M_target.wav","M_target_snd");
- createSound("M_wolf.wav","M_wolf_snd");
- createSound("T_musicFinalTheme.wav","T_musicFinalTheme_snd");
- createSound("T_musicIntro.wav","T_musicIntro_snd");
- createSound("T_musicMainTheme.wav","T_musicMainTheme_snd");
- B_can_snd.setVolume(100);
- B_extraBall_snd.setVolume(80);
- B_lose_snd.setVolume(100);
- B_stool_snd.setVolume(80);
- B_win_snd.setVolume(100);
- M_ballThud_snd.setVolume(50);
- M_barrel_snd.setVolume(50);
- M_bumper_snd.setVolume(50);
- M_cart1_snd.setVolume(100);
- M_cart2_snd.setVolume(100);
- M_cart3_snd.setVolume(100);
- M_cart4_snd.setVolume(100);
- M_cart5_snd.setVolume(100);
- M_ding_snd.setVolume(80);
- M_flipper_snd.setVolume(50);
- M_horse_snd.setVolume(80);
- M_launchNewBall_snd.setVolume(60);
- M_mainRamp_snd.setVolume(60);
- M_rampBallKicked_snd.setVolume(60);
- M_rampThud_snd.setVolume(80);
- M_saloonDoor_snd.setVolume(100);
- M_scoreTotal_snd.setVolume(80);
- M_target_snd.setVolume(60);
- T_musicFinalTheme_snd.setVolume(100);
- T_musicIntro_snd.setVolume(100);
- T_musicMainTheme_snd.setVolume(100);
- cartSoundArr = new Array(M_cart1_snd,M_cart2_snd,M_cart3_snd,M_cart4_snd,M_cart5_snd);
- }
- function createSound(id, name)
- {
- soundDepth++;
- instName = "sound" + soundDepth + "_mc";
- soundHolder.createEmptyMovieClip(instName,soundDepth);
- var mc = soundHolder[instName];
- _root[name] = new Sound(mc);
- _root[name].attachSound(id);
- }
- function playSound(snd)
- {
- if(soundOn)
- {
- snd.start();
- }
- }
- function playSoundLoop(snd)
- {
- if(soundOn)
- {
- snd.start(0,1000);
- }
- }
- function playSoundVolume(snd, volume)
- {
- if(soundOn)
- {
- snd.setVolume(volume);
- snd.start();
- }
- }
- function stopSound(snd)
- {
- snd.stop();
- }
- function fadeSound(snd)
- {
- fader.snd = snd;
- fader.gotoAndPlay("start");
- }
- function calculateVolume(velocity)
- {
- var volume = Math.floor(dist(0,0,velocity.x,velocity.y) * 100 / maxSpeed);
- if(volume > 100)
- {
- volume = 100;
- }
- return volume;
- }
- initSounds();
- stopSound(T_musicFinalTheme_snd);
- stopSound(T_musicIntro_snd);
- stopSound(T_musicMainTheme_snd);
- musicIntro_snd.stop();
-