2 Replies Latest reply: Mar 12, 2014 1:06 PM by mrwizzer2 RSS

    Pause Event Sounds?

    mrwizzer2 Community Member

      I'm wondering if there's a way to pause Event sounds.

       

      When using Flash's new ability to export content to an HTML5 canvas format, streaming sounds are no longer permitted, only Event sounds. 

       

      I've got a Pause button on the stage to let the user pause the presentation when desired.  this.stop();  works just fine pausing the animation, but the sound continues on, as Event sounds are wont to do. 

       

      How does one pause the audio if we're required to use only Event sounds?

        • 1. Re: Pause Event Sounds?
          kglad CommunityMVP

          use javascript to play and pause your sound.

          • 2. Re: Pause Event Sounds?
            mrwizzer2 Community Member

            Thanks for the reply, kglad.

             

            The audio is synched tightly to the animation, so it would probably be best to have the audio's playback initiated by inserting it on the timeline.  So I'm wondering how to use javascript to pause the audio that has already begun playing on the timeline.

             

            Looking at the .js file that is exported when I publish the presentation, I see the timeline audio has an ID assigned to it, based on the name of the audio file placed on the timeline.

             

            Giving that the audio's ID is labeled "myTimelineAudio",  I've attempted to use the following javascript to pause the audio:

             

            var myAudio = document.getElementById('myTimelineAudio');

                      myAudio.pause();

             

            ...but it's not working.  Any suggestions?