Skip to main content
Participant
July 25, 2020
Question

In a bit of an animate HTML5 pickle regarding sound fx and music

  • July 25, 2020
  • 4 replies
  • 333 views

Hi all,

 

I seem to have got my self into a pickle where I used to create animations with sound using flash cs5 and now with flash  (.swf) files going I've recreated my animation with Animate and a HTML5 canvas but no sound!

 

Ive tried using the HTML5 audio component but I dont want to autoplay a sound like that I want it to happen more often with the action on screen.

 

What am I not getting lol

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    kglad
    Community Expert
    Community Expert
    July 25, 2020

    if you have a sound in your library with linkage id = soundID, you can use:

     

    var sound = createjs.Sound.createInstance("soundID");

    sound.play();

     

    p.s.  you may need user interaction with page before sound will play.

    JonnyC1Author
    Participant
    July 25, 2020

    Hi thanks for your quick reply. So if I get this right. I can use the
    JavaScript to play different sounds as the play head travels across the
    timeline?

    My animation contains a surfer learning to surf with background music
    playing thought out then on two occasions he says surfs up and better luck
    next time. Can I trigger those without having to bind them to a button for the user to click. 

    Thanks

     

    Jonny

    Legend
    July 26, 2020

    Playing sounds as the playhead travels across the timeline is literally what timeline audio is for. Why are you messing around with the audio component? That's for programmatic audio.