SHARE
TWEET

Everybody Edits - Gong

capasha Sep 29th, 2018 160 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //In Sounds > SoundManager.as.
  2.  
  3. public static function init() : void
  4.       {
  5.          miscSounds[SoundId.COIN] = new Coin();
  6.          miscSounds[SoundId.BANNED] = new Banned();
  7.          miscSounds[SoundId.OVER9000] = new Over9000();
  8.          miscSounds[SoundId.WOOT_UP] = new WootUp();
  9.          miscSounds[SoundId.LIKE] = new Like();
  10.          miscSounds[SoundId.UNLIKE] = new Unlike();
  11.          miscSounds[SoundId.FAVORITE] = new Favorite();
  12.          miscSounds[SoundId.UNFAVORITE] = new Unfavorite();
  13.          miscSounds[SoundId.MAGIC] = new Magic();
  14.          miscSounds[SoundId.DONTPANIC] = new DontPanic();
  15.          miscSounds[SoundId.CLICK] = new Click();
  16.          miscSounds[SoundId.GONG] = new Gong(); //Found the gong sound as miscSounds
  17.          }
  18.  
  19. //Play a sound. Remember that gong is inside miscSounds.
  20. public static function playAnySound(param1:String) : Boolean
  21.       {
  22.          var id:String = param1;
  23.          try
  24.          {
  25.             if(id.indexOf("piano") == 0)
  26.             {
  27.                return playPianoSound(int(id.substr(5)));
  28.             }
  29.             if(id.indexOf("drum") == 0)
  30.             {
  31.                return playDrumSound(int(id.substr(4)));
  32.             }
  33.             if(id.indexOf("guitar") == 0)
  34.             {
  35.                return playGuitarSound(int(id.substr(6)));
  36.             }
  37.             return playMiscSound(id); //Here do we return the id of miscSound
  38.          }
  39.          catch(e:Error)
  40.          {
  41.          }
  42.          return false;
  43.       }
  44. public function showInfo2(param1:String, param2:String, param3:String = null) : void
  45.       {
  46.          var mouseDown:Boolean = false;
  47.          var title:String = param1;
  48.          var body:String = param2;
  49.          var sound:String = param3;
  50.             //removed useless code.
  51.  
  52.          //If sound is not null
  53.          if(sound)
  54.          {
  55.             //Play the song through SoundManager
  56.             SoundManager.playAnySound(sound);
  57.          }
  58.       }
  59.  
  60. //In Everybodyedits.as
  61. connection.addMessageHandler("info2",function(param1:Message, param2:String, param3:String, param4:String = null):void
  62.          {
  63.             //param4 is the sound id
  64.             showInfo2(param2,param3,param4);
  65.          });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top