home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / FreeSoftware / MicrosoftXP / music.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2001-03-22  |  620 b   |  35 lines

  1. function toggleSound()
  2. {
  3.    if(_root.soundOff)
  4.    {
  5.       _root.soundOff = false;
  6.    }
  7.    else
  8.    {
  9.       _root.soundOff = true;
  10.    }
  11.    playMusic();
  12. }
  13. function playMusic()
  14. {
  15.    if(!_root.soundOff)
  16.    {
  17.       _root.mySound = new Sound("sound_mov");
  18.       _root.mySound.attachSound(_root.currentSound);
  19.       _root.mySound.start(0,9999);
  20.       _root.mySound.setVolume(100);
  21.       _root.playing = "true";
  22.    }
  23.    else
  24.    {
  25.       _root.mySound.stop();
  26.       _root.playing = "false";
  27.    }
  28. }
  29. function setMusic(name)
  30. {
  31.    _root.mySound.stop();
  32.    _root.currentSound = name;
  33.    playMusic();
  34. }
  35.