Yepp, it works. I coded a SoundManager class that basically implements
the same functionality some time ago so I'm not sure why it's not
working on your side.

Dirk.

At 01:51 PM 7/27/2005, you wrote:
>Dirk, thanks for the suggestion - but still no luck. Same problem: 
>sound plays, no onSoundComplete execution. Were you able to get this to
work?
>
>Here's my revised code:
>
>           function startSound(currentSound)
>                   {
>                          feedback.text += currentSound+" playing now";
>                          glow.alpha = 100;
>                          var snd:Sound = new Sound();
>                          snd.attachSound(currentSound);
>                          snd.onSoundComplete = 
>mx.utils.Delegate.create(this, soundStopped);
>                          snd.start();
>                           }
>
>          function soundStopped()
>                  {
>                                  glow.alpha = 0;
>                                  feedback.text += " stopping now";
>                  }
>
>At 09:37 AM 7/27/2005, you wrote:
> >There's still a scoping problem. Try this:
> >
> >function startSound(currentSound) {
> >   feedback.text += currentSound+" playing now";
> >   glow.alpha = 100;
> >   var snd:Sound = new Sound();
> >   snd.attachSound(currentSound);
> >   snd.onSoundComplete = mx.utils.Delegate.create(this,
soundStopped);
> >   snd.start();
> >}
> >
> >function soundStopped() {
> >   glow.alpha = 0;
> >   feedback.text += " stopping now";
> >}
> >
> >Dirk.
> >
> >-----Original Message-----
> >From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
> >On Behalf Of Tom Fitzpatrick
> >Sent: Wednesday, July 27, 2005 2:26 PM
> >To: flexcoders@yahoogroups.com
> >Subject: RE: [flexcoders] sound problem: onSoundComplete
> >
> >Matt - I made your modification in my code, and still have the same
> >problem: sound plays OK, but the onSoundComplete actions (trace and 
> >reset
> >alpha) never take place.
> >
> >Here's the modified code:
> >
> >           function startSound(currentSound)
> >                  {
> >                          feedback.text += currentSound+" playing
now";
> >                          glow.alpha = 100;
> >                          var snd:Sound = new Sound();
> >                          snd.attachSound(currentSound);
> >                          snd.onSoundComplete = 
> >mx.utils.Delegate.create(this, function()
> >                          {
> >                                  glow.alpha = 0;
> >                                  feedback.text += " stopping now";
> >                          });
> >                  snd.start();
> >                          }
> >
> >Any other ideas?
> >
> >- Tom
> >
> >At 09:41 PM 7/26/2005, you wrote:
> > >snd.onSoundComplete = mx.utils.Delegate.create(this, function() {
> > >   //same body here
> > >});
> > >
> > >You're having scoping problems.
> > >
> > >Matt
> > >
> > >
> > >----------
> > >From: flexcoders@yahoogroups.com 
> > >[mailto:[EMAIL PROTECTED] On
> >
> > >Behalf Of Tom Fitzpatrick
> > >Sent: Tuesday, July 26, 2005 2:30 PM
> > >To: flexcoders@yahoogroups.com
> > >Subject: [flexcoders] sound problem: onSoundComplete
> > >
> > >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>http:
> > >//groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > >Search Archives:
> > ><http://www.mail-archive.com/flexcoders%40yahoogroups.com>http://ww
> > >w.ma il-archive.com/flexcoders%40yahoogroups.com
> > >
> > >
> > >
> > >
> > >----------
> > >YAHOO! GROUPS LINKS
> > >
> > >    *  Visit your group
> > > "<http://groups.yahoo.com/group/flexcoders>flexcoders" on the web.
> > >    *
> > >    *  To unsubscribe from this group, send an email to:
> > >    *
> > > <mailto:[EMAIL PROTECTED]
> > > >fle [EMAIL PROTECTED]
> > >
> > >    *
> > >    *  Your use of Yahoo! Groups is subject to the 
> > > <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
> > >
> > >
> > >----------
> >
> >
> >
> >
> >
> >
> >--
> >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
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >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
> >
> >
> >
> >
>
>
>
>
>
>
>--
>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
>
>
>
>





--
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



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hln13c4/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122647517/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

--
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