home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / eroticos / spankthebooty.swf / scripts / __Packages / SoundManager.as < prev   
Text File  |  2005-10-13  |  2KB  |  55 lines

  1. class SoundManager
  2. {
  3.    static var sounds = new Object();
  4.    static var soundOn = true;
  5.    static var musicSound = null;
  6.    function SoundManager()
  7.    {
  8.    }
  9.    static function changeState()
  10.    {
  11.       SoundManager.soundOn = !SoundManager.soundOn;
  12.       if(SoundManager.soundOn)
  13.       {
  14.          SoundManager.sounds.volumiser.setVolume(100);
  15.          return "Sound ON";
  16.       }
  17.       SoundManager.sounds.volumiser.setVolume(0);
  18.       return "Sound OFF";
  19.    }
  20.    static function init()
  21.    {
  22.       SoundManager.sounds.volumiser = new Sound();
  23.       SoundManager.sounds.wak = new Sound();
  24.       SoundManager.sounds.wak.attachSound("hit");
  25.       SoundManager.sounds.swing = new Sound();
  26.       SoundManager.sounds.swing.attachSound("swing");
  27.    }
  28.    static function wak()
  29.    {
  30.       SoundManager.sounds.wak.start(0.17);
  31.    }
  32.    static function swing()
  33.    {
  34.       if(SoundManager.sounds.swing.position == 0 || SoundManager.sounds.swing.position == SoundManager.sounds.swing.duration)
  35.       {
  36.          SoundManager.sounds.swing.start();
  37.       }
  38.    }
  39.    static function musicOn()
  40.    {
  41.       var _loc1_ = _root.createEmptyMovieClip("music",997);
  42.       SoundManager.musicSound = new Sound(_loc1_);
  43.       SoundManager.musicSound.attachSound("music");
  44.       SoundManager.musicSound.start(0,99999);
  45.    }
  46.    static function setMusicLow()
  47.    {
  48.       SoundManager.musicSound.setVolume(65);
  49.    }
  50.    static function setMusicHigh()
  51.    {
  52.       SoundManager.musicSound.setVolume(100);
  53.    }
  54. }
  55.