soundchannel - Actionscript 3: more than one sound channel possible? -
soundchannel - Actionscript 3: more than one sound channel possible? -
my problem having several buttons in flash play sounds when clicked, , want 1 button/sound active @ time. problem if mouse button released outside of flash window lastly button's sound keeps sounding til end, , if button pressed in meantime starts sounding simultaneously, , on.
so thought of checking if soundchannel assigned other button pressed 1 playing, , if so, stop soundchannel allow current button's soundchannel play.
but if actionscript soundchannel single object buttons, won't work, , don't see solution preventing multiple sounds sounding simultaneously other adding 'warning' box, seems redundant , ineffective. can have separate soundchannel each button or object in flash movie, otherwise how can bulletproof 1 button sound can sound @ 1 time no matter mouse released, within or outside of flash window?
can set buttons in container , addeventlistener mouseevent.mouse_up , in handler check if cursor outside container so:
private static function onmousedownoutside(event:mouseevent) : void { var mousedowninsidecomponent : boolean = false; mousedowninsidecomponent = yourcontainer.hittestpoint(event.stagex, event.stagey, false); if (!mousedowninsidecomponent) { //stop sound } }
and stop sound when gets out of container? seems possible workaround.
actionscript soundchannel
Comments
Post a Comment