Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi this is where I'm really confused with the html5 canvas.
Any sounds I put into a key frame onto the timeline do not play when published out to the html5 webpage. The final output needs to be html5 compliant with the animation embedded into a webpage (it can't be a .SWF)
The copious amounts of googling I did led me to the audio component which doesn't work with multiple auto play sounds.
What's my next step?