2 Replies Latest reply on Jun 3, 2011 11:29 AM by asura_b

    sound pause and resume

    calhoontuna
      Built an audio pause/resume button. The idea is that you hit the button once and it will pause sound. Hit it again and the sound will resume right where you left off. Problem is that sometimes the button works while at other times you'll hit it and start up another instance of the same audio track so that you'll be hearing the sound doubled but half a second off. It's variable sometimes it works, sometimes not. Hoping someone can tell me what's going on here.

      The specifics: I have 37 slides, each of which is accompanied by a sound bite. The sound was imported into Flash than linked and exported for ActionScript. On each slide, the audio is called by:
      stop();
      mySound=new Sound(this);
      mySound.attachSound("25");
      mySound.onSoundcomplete=function()
      {
      nextFrame();
      };
      mySound.start(0,1);

      The pause button has the following ActionScript attached to it:
      on(release){
      if(!paused){
      soundPosition=mySound.postion/1000
      mySound.stop();
      paused=true;
      }else{
      mysound.start(soundPosition,true);
      paused=false;
      }
      }