17 Replies Latest reply on May 14, 2009 11:32 AM by kglad

    How to play a soud at specific frame?

    aljCharlie Level 1

      I have the loading audio file at frame one. However, I want to play the audio only at specific frame or frame lable. How do I do that? Below are my codes:

       

      //start of sound section is for sound
      var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/mySoundmp3");
      var sound:Sound = new Sound();
      sound.load(soundReq);
      sound.addEventListener(Event.COMPLETE, onComplete);
      //end of sound section

       

      function onComplete(event:Event):void
      {
          sound.play();
      }

       


      The above plays the sound as soon as the .swf file is loaded. But I want to play at certain point in time, say frame number or frame lable.