Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AS3: Event.SOUND_COMPLETE event not firing

1,116 views
Skip to first unread message

dubya

unread,
Sep 23, 2007, 2:28:24 PM9/23/07
to
hey everyone

have a look at the attached code. its not very complex but for some reason i
can't get the onPlaybackComplete method to fire. any ideas why? SoundClick is
an mp3 in the library set to export as an extension of the Sound class. it
plays fine, so presumably extending Sound and accessing its methods is working
ok, just cant get that sound_complete event to fire


package ccg.gui {

import ccg.gui.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;

public class RiderAudio2 {

private var _effectGenericClick :SoundClick;

public function RiderAudio2 ()
{
trace("RiderAudio INIT");
_effectGenericClick = new SoundClick();
_effectGenericClick.addEventListener( Event.SOUND_COMPLETE,
onPlaybackComplete );
_effectGenericClick.play();
};

public function onPlaybackComplete ( e:Event ):void
{
trace("RiderAudio onPlaybackComplete ");
};
};
};

Craig Grummitt

unread,
Oct 1, 2007, 12:51:05 AM10/1/07
to
You need to use the SoundChannel class to listen for SoundComplete.


package ccg.gui {

import ccg.gui.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;

public class RiderAudio2 {

private var _effectGenericClick:SoundClick;

private var channel:SoundChannel;



public function RiderAudio2 ()
{
trace("RiderAudio INIT");
_effectGenericClick = new SoundClick();

channel = _effectGenericClick.play();
channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);

0 new messages