Note that there are some explanatory texts on larger screens.

plurals
  1. POExternally loaded sounds echoes in certain browsers
    text
    copied!<p>I'm struggeling with a problem where, in Chrome on Mac and in Chrome, Opera and Safari on PC, it appears to be playing sounds twice, generating an unwanted echo-effect with a rather random delay(always under half a second though).</p> <p>I have 2 swf-files that communictes through a LocalConnection, the main swf simply calls a function on the second swf and passing a url to an mp3-file as parameter. The second swf then loads the file and onComplete plays it.</p> <p>This works perfectly on IE(that's a first) and Firefox on both mac and PC but echoes as mentioned above.</p> <p>I even implemented a double-check to make sure a sound wouldn't play if a sound is already playing.</p> <p>Some sample code:</p> <pre><code>var audio:Sound; var isPlayingSound:Boolean = false; var soundURL:String; public function lcRecieve(url:String = ""):void{ soundURL = url; if (soundOn &amp;&amp; !isPlayingSound){ playSound(); } } public function playSound():void { if(!isPlayingSound){ audio = new Sound(new URLRequest(soundURL)); audio.addEventListener(Event.COMPLETE, onSoundComplete); } } public function onSoundComplete(e:Event):void{ audio.play(0, 1).addEventListener(Event.SOUND_COMPLETE, soundFinnishedPlaying); isPlayingSound = true; } private function soundFinnishedPlaying(e:Event):void { e.target.removeEventListener(Event.SOUND_COMPLETE, soundFinnishedPlaying); audio = null; isPlayingSound = false; } </code></pre> <p>Anyone stumbeled upon this problem before? I'm very much lost.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload