Skip to main content
Inspiring
March 12, 2014
Question

Pause Event Sounds?

  • March 12, 2014
  • 2 replies
  • 905 views

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?

This topic has been closed for replies.

2 replies

Participating Frequently
August 24, 2015

Is there a solution for this?!

kglad
Community Expert
Community Expert
March 12, 2014

use javascript to play and pause your sound.

mrwizzer2Author
Inspiring
March 12, 2014

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?