Skip to main content
joergsieger
Participant
April 12, 2018
Answered

Flash Animation -> HTML5 - Audio stop and start by Button

  • April 12, 2018
  • 1 reply
  • 1135 views

I have a Flash Animation and try to convert in html5.

there is a mp3-file in the timeline and animations belonging to the sound.

In Flash I stop the animation by button and the sound stops also.

In HTML5 I can stop and start the timeline by button but not the sound.

I found solutions without soundfile in the timeline. but animation and sound should be connected.

I try

_main = this; 

createjs.Sound.on("fileload", handleLoad); 

createjs.Sound.registerSound("ich_1.mp3", "soundID"); 

function handleLoad(event) { 

    _main.audio1 = createjs.Sound.play("soundID"); 

}

this.buttonPause.addEventListener("click", fl_MouseClickHandler_8.bind(this));

function fl_MouseClickHandler_8()

{

    this.audio1.paused = true;

    this.stop();

}

this.buttonWeiter.addEventListener("click", fl_MouseClickHandler_9.bind(this));

function fl_MouseClickHandler_9()

{

    this.audio1.paused = false;

    this.play();

}

But it dosn't work 😞

    This topic has been closed for replies.
    Correct answer Preran

    From what I understand, you are able to stop the animation and sound by pressing a button during preview in Flash Pro. However, when you publish the file to HTML5, the animation stops when you click the stop button, but the sound continues playing.

    I am not an expert on this topic, but just to be sure, have you had a look at these articles?

    stop sound with action script?

    flash - How can you stop a sound from playing in as3? - Stack Overflow

    Thanks,

    Preran

    1 reply

    Preran
    PreranCorrect answer
    Legend
    April 16, 2018

    From what I understand, you are able to stop the animation and sound by pressing a button during preview in Flash Pro. However, when you publish the file to HTML5, the animation stops when you click the stop button, but the sound continues playing.

    I am not an expert on this topic, but just to be sure, have you had a look at these articles?

    stop sound with action script?

    flash - How can you stop a sound from playing in as3? - Stack Overflow

    Thanks,

    Preran