Skip to main content
Participant
April 18, 2021
Question

Sound activation

  • April 18, 2021
  • 1 reply
  • 143 views

Many years ago, using flash, i learned how to use sound to trigger events using actionscript.

But I can't now remember.

I can't seem to find any help on this subject.

Lots of help on triggering sound using actionscript, but i want to make animation sound reactive.

 

Any help,

 

Thanks.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 18, 2021

in what way do you want to use sound to trigger an event?

 

for example, you might want the end (completion) of a sound to trigger an event.  then you would use something like:

 

var soundCompleteE:Event=new Event("soundCompleteE");

var yoursoundchannel:SoundChannel = yoursound.play();

yoursoundchannel.addEventListener(Event.SOUND_COMPLETE, soundCompleteF);


function soundCompleteF(e:Event):void {
dispatchEvent(soundCompleteE);
}