home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Frizzle_fraz.swf / scripts / Code / LIB / SOUND / _wj196.as < prev   
Encoding:
Text File  |  2008-09-26  |  5.6 KB  |  208 lines

  1. package Code.LIB.SOUND
  2. {
  3.    import Code.LIB.COMPONENTS._vw412;
  4.    import Code.LIB._nd174;
  5.    import Code.OPTIONS._dx111;
  6.    import flash.events.MouseEvent;
  7.    import flash.media.Sound;
  8.    import flash.media.SoundChannel;
  9.    import flash.media.SoundMixer;
  10.    import flash.media.SoundTransform;
  11.    import flash.utils.*;
  12.    
  13.    public class _wj196
  14.    {
  15.       
  16.       private static var iSTransform:SoundTransform = new SoundTransform();
  17.       
  18.       public static var iMusic:_vw412;
  19.       
  20.       private static var iMTransform:SoundTransform = new SoundTransform();
  21.       
  22.       private static var savedSoundsV:Number;
  23.       
  24.       private static var iSounds:Array = new Array();
  25.       
  26.       private static var iSChannel:SoundChannel = new SoundChannel();
  27.       
  28.       private static var iMChannel:SoundChannel = new SoundChannel();
  29.       
  30.       private static var iSoundVolume:Number = 1;
  31.       
  32.       public static var iSound:_vw412;
  33.       
  34.       private static var iList:_mv52;
  35.       
  36.       public static var iMusPlaying:Boolean = false;
  37.       
  38.       private static var iMusikVolume:Number;
  39.       
  40.       private static var savedMusicV:Number;
  41.        
  42.       
  43.       public function _wj196()
  44.       {
  45.          super();
  46.       }
  47.       
  48.       public static function get _qt85() : Number
  49.       {
  50.          return iSoundVolume;
  51.       }
  52.       
  53.       public static function _nx391(param1:MouseEvent) : void
  54.       {
  55.          switch(param1.target)
  56.          {
  57.             case iMusic.iButton._ol346:
  58.                if(iMusic.State == _vw412.stOnn)
  59.                {
  60.                   savedMusicV = _ao83;
  61.                   _ao83 = 0;
  62.                   iMusic.State = _vw412.stOff;
  63.                }
  64.                else
  65.                {
  66.                   _ao83 = !!savedMusicV ? savedMusicV : 0.7;
  67.                   iMusic.State = _vw412.stOnn;
  68.                }
  69.                _nd174._tp546();
  70.                break;
  71.             case iSound.iButton._ol346:
  72.                if(iSound.State == _vw412.stOnn)
  73.                {
  74.                   savedSoundsV = _qt85;
  75.                   _qt85 = 0;
  76.                   iSound.State = _vw412.stOff;
  77.                }
  78.                else
  79.                {
  80.                   _qt85 = !!savedSoundsV ? savedSoundsV : 0.7;
  81.                   iSound.State = _vw412.stOnn;
  82.                }
  83.                _nd174._tp546();
  84.          }
  85.       }
  86.       
  87.       public static function get _ao83() : Number
  88.       {
  89.          return iMusikVolume;
  90.       }
  91.       
  92.       public static function _nk262(param1:Array) : void
  93.       {
  94.          var _loc2_:Array = null;
  95.          var _loc3_:Array = null;
  96.          var _loc4_:Sound = null;
  97.          iSound = new _vw412(_dx111.TSpeakerOnn,_dx111.TSpeakerOff);
  98.          iSound._vt351 = 750;
  99.          iMusic = new _vw412(_dx111.TMusicOnn,_dx111.TMusicOff);
  100.          iMusic._vt351 = 700;
  101.          iSound._lh238 = 0;
  102.          iMusic._lh238 = 0;
  103.          iSound.addEventListener(MouseEvent.MOUSE_DOWN,_nx391);
  104.          iMusic.addEventListener(MouseEvent.MOUSE_DOWN,_nx391);
  105.          iSTransform.volume = iSoundVolume;
  106.          iMTransform.volume = iMusikVolume;
  107.          _loc2_ = iSounds;
  108.          for each(_loc3_ in param1)
  109.          {
  110.             _loc4_ = new _loc3_[1]() as Sound;
  111.             iSounds.push([_loc3_[0],_loc4_]);
  112.          }
  113.          _wj196.iList = new _mv52(iSTransform);
  114.       }
  115.       
  116.       public static function set _ao83(param1:Number) : void
  117.       {
  118.          iMusikVolume = param1;
  119.          iMTransform.volume = iMusikVolume;
  120.          iMChannel.soundTransform = iMTransform;
  121.          if(iMusikVolume == 0)
  122.          {
  123.             iMusic.State = _vw412.stOff;
  124.          }
  125.          else
  126.          {
  127.             iMusic.State = _vw412.stOnn;
  128.          }
  129.          if(_nd174._ai238)
  130.          {
  131.             _nd174._ai238[1].prMVolume = param1;
  132.          }
  133.       }
  134.       
  135.       public static function _rh198() : void
  136.       {
  137.          iSChannel.stop();
  138.       }
  139.       
  140.       public static function _ss148() : void
  141.       {
  142.          iMusPlaying = false;
  143.          SoundMixer.stopAll();
  144.       }
  145.       
  146.       public static function _ti225(param1:String) : void
  147.       {
  148.          _wj196.iList.add(_rm64(param1));
  149.       }
  150.       
  151.       public static function _va384(param1:String, param2:Boolean = false) : void
  152.       {
  153.          var _loc3_:Sound = null;
  154.          iSTransform.volume = iSoundVolume;
  155.          iMTransform.volume = iMusikVolume;
  156.          _loc3_ = _rm64(param1);
  157.          if(!_loc3_)
  158.          {
  159.             return;
  160.          }
  161.          if(param2)
  162.          {
  163.             if(iMusPlaying)
  164.             {
  165.                return;
  166.             }
  167.             iMusPlaying = true;
  168.             iMChannel.stop();
  169.             iMChannel = _loc3_.play(0,999,iMTransform);
  170.          }
  171.          else
  172.          {
  173.             iSChannel = _loc3_.play(0,0,iSTransform);
  174.          }
  175.       }
  176.       
  177.       public static function set _qt85(param1:Number) : void
  178.       {
  179.          iSoundVolume = param1;
  180.          if(_nd174._ai238)
  181.          {
  182.             _nd174._ai238[1].prSVolume = param1;
  183.          }
  184.          if(iSoundVolume == 0)
  185.          {
  186.             iSound.State = _vw412.stOff;
  187.          }
  188.          else
  189.          {
  190.             iSound.State = _vw412.stOnn;
  191.          }
  192.       }
  193.       
  194.       private static function _rm64(param1:String) : Sound
  195.       {
  196.          var _loc2_:Array = null;
  197.          for each(_loc2_ in iSounds)
  198.          {
  199.             if(_loc2_[0] == param1)
  200.             {
  201.                return Sound(_loc2_[1]);
  202.             }
  203.          }
  204.          return null;
  205.       }
  206.    }
  207. }
  208.