Trying to get onSoundComplete() to work - but it never seems to get called.

Here's the code I'm working with:

        function startSound(currentSound)
        {
                 feedback.text += currentSound+" playing now";
                glow.alpha = 100;
                var snd:Sound = new Sound();
                snd.attachSound(currentSound);
                snd.onSoundComplete = function()
                {
                        glow.alpha = 0;
                        feedback.text += " stopping now";
                }
                snd.start();
        }

The "currentSound" parameter is the name of an mp3. The startSound function 
is called as the change event from a comboBox used to select the sound to 
be played. The sound gets played just fine, but the onSoundComplete 
function never executes.

The "feedback.text" mechanism is a trace - and the text "stopping now" 
never gets called.

The "glow" object is an imported .swf whose alpha is supposed to change 
when the sound is complete.

- Tom






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to