RE: [flexcoders] sound problem: onSoundComplete

2005-07-26 Thread Matt Chotin










snd. function()

{

  //same body here

});

 

You’re having scoping problems.

 

Matt

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 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.>
 
  {
 
    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



   Visit your group "flexcoders" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











RE: [flexcoders] sound problem: onSoundComplete

2005-07-27 Thread Tom Fitzpatrick
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
>Search Archives: 
>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> 
>
>
>
>
>--
>YAHOO! GROUPS LINKS
>
>*  Visit your group 
> "flexcoders" on the web.
>*
>*  To unsubscribe from this group, send an email to:
>* 
> [EMAIL PROTECTED] 
>
>*
>*  Your use of Yahoo! Groups is subject to the 
> 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

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




RE: [flexcoders] sound problem: onSoundComplete

2005-07-27 Thread Dirk Eismann
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://www.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

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





RE: [flexcoders] sound problem: onSoundComplete

2005-07-27 Thread Tom Fitzpatrick
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://www.ma
> >il-archive.com/flexcoders%40yahoogroups.com
> >
> >
> >
> >
> >

RE: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread Tom Fitzpatrick
Just trying to bump this problem up - still looking for a solution.

I've tried a bunch of different combinations to make the onSoundComplete 
method work, none of which do the trick. The docs - which perhaps were 
repurposed from Flash - make no mention of the scoping issue. Anyone have 
suggestions or a "hello world" level example?

- Tom

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 

RE: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread Jeff Tapper
I'm having no problems with this.  To test, just replace the url variable 
with some local sound on your machine.  One key difference to note, im 
using loadSound rather than attachSound.  Not sure why that matters, but it 
might


http://www.macromedia.com/2003/mxml";
 creationComplete="appInit()">

 
 
 




At 02:47 PM 7/28/2005, Tom Fitzpatrick wrote:
>Just trying to bump this problem up - still looking for a solution.
>
>I've tried a bunch of different combinations to make the onSoundComplete
>method work, none of which do the trick. The docs - which perhaps were
>repurposed from Flash - make no mention of the scoping issue. Anyone have
>suggestions or a "hello world" level example?
>
>- Tom
>
>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
> > >calle

Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread JesterXL
loadSound will load an mp3 file external to the SWF.

attachSound will play a sound that has been embedded in the SWF file.


- Original Message - 
From: "Jeff Tapper" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, July 28, 2005 3:10 PM
Subject: RE: [flexcoders] sound problem: onSoundComplete


I'm having no problems with this.  To test, just replace the url variable
with some local sound on your machine.  One key difference to note, im
using loadSound rather than attachSound.  Not sure why that matters, but it
might


http://www.macromedia.com/2003/mxml";
 creationComplete="appInit()">

 
 
 




At 02:47 PM 7/28/2005, Tom Fitzpatrick wrote:
>Just trying to bump this problem up - still looking for a solution.
>
>I've tried a bunch of different combinations to make the onSoundComplete
>method work, none of which do the trick. The docs - which perhaps were
>repurposed from Flash - make no mention of the scoping issue. Anyone have
>suggestions or a "hello world" level example?
>
>- Tom
>
>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
> > >
> > > >B

Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread Jeff Tapper
Good enough, heres an example reworked using an embeded 
sound.  onSoundComplete still fires flawlessly.  Perhaps the problem was 
that Tom had the Sound variable scoped locally to the function, while I 
have mine accessible to the whole class.




http://www.macromedia.com/2003/mxml";
 creationComplete="appInit()">

 
 
 




At 03:15 PM 7/28/2005, you wrote:
>loadSound will load an mp3 file external to the SWF.
>
>attachSound will play a sound that has been embedded in the SWF file.
>
>
>- Original Message -
>From: "Jeff Tapper" <[EMAIL PROTECTED]>
>To: 
>Sent: Thursday, July 28, 2005 3:10 PM
>Subject: RE: [flexcoders] sound problem: onSoundComplete
>
>
>I'm having no problems with this.  To test, just replace the url variable
>with some local sound on your machine.  One key difference to note, im
>using loadSound rather than attachSound.  Not sure why that matters, but it
>might
>
>
>  width="800" height="600"
> 
>xmlns:mx="<http://www.macromedia.com/2003/mxml>http://www.macromedia.com/2003/mxml";
>  creationComplete="appInit()">
>
>  
>  
>  
>
>
>
>
>At 02:47 PM 7/28/2005, Tom Fitzpatrick wrote:
> >Just trying to bump this problem up - still looking for a solution.
> >
> >I've tried a bunch of different combinations to make the onSoundComplete
> >method work, none of which do the trick. The docs - which perhaps were
> >repurposed from Flash - make no mention of the scoping issue. Anyone have
> >suggestions or a "hello world" level example?
> >
> >- Tom
> >
> >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.onSoundComp

Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread JesterXL
The Activation Object is the weirdest beast... XML & LoadVars will both stay 
around AND fire their onLoad/onData events even if you declare them as local 
vars.

While this is nice to save on member variables, no one knows what the heck 
garbage collection does with them, so doing things your way is recommended.

...still, I have in the past gotten onSoundComplete to work via a local var 
so not sure...

- Original Message - 
From: "Jeff Tapper" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, July 28, 2005 3:36 PM
Subject: Re: [flexcoders] sound problem: onSoundComplete


Good enough, heres an example reworked using an embeded
sound.  onSoundComplete still fires flawlessly.  Perhaps the problem was
that Tom had the Sound variable scoped locally to the function, while I
have mine accessible to the whole class.




http://www.macromedia.com/2003/mxml";
 creationComplete="appInit()">

 
 
 




At 03:15 PM 7/28/2005, you wrote:
>loadSound will load an mp3 file external to the SWF.
>
>attachSound will play a sound that has been embedded in the SWF file.
>
>
>- Original Message -
>From: "Jeff Tapper" <[EMAIL PROTECTED]>
>To: 
>Sent: Thursday, July 28, 2005 3:10 PM
>Subject: RE: [flexcoders] sound problem: onSoundComplete
>
>
>I'm having no problems with this.  To test, just replace the url variable
>with some local sound on your machine.  One key difference to note, im
>using loadSound rather than attachSound.  Not sure why that matters, but it
>might
>
>
>  width="800" height="600"
>
>xmlns:mx="<http://www.macromedia.com/2003/mxml>http://www.macromedia.com/2003/mxml";
>  creationComplete="appInit()">
>
>  
>  
>  
>
>
>
>
>At 02:47 PM 7/28/2005, Tom Fitzpatrick wrote:
> >Just trying to bump this problem up - still looking for a solution.
> >
> >I've tried a bunch of different combinations to make the onSoundComplete
> >method work, none of which do the trick. The docs - which perhaps were
> >repurposed from Flash - make no mention of the scoping issue. Anyone have
> >suggestions or a "hello world" level example?
> >
> >- Tom
> >
> >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 

Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread Jeff Tapper
As I say, not entirely sure why mine works when the original doesnt, but it 
works, which is good enough for now.

At 03:49 PM 7/28/2005, you wrote:
>The Activation Object is the weirdest beast... XML & LoadVars will both stay
>around AND fire their onLoad/onData events even if you declare them as local
>vars.
>
>While this is nice to save on member variables, no one knows what the heck
>garbage collection does with them, so doing things your way is recommended.
>
>...still, I have in the past gotten onSoundComplete to work via a local var
>so not sure...
>
>- Original Message -
>From: "Jeff Tapper" <[EMAIL PROTECTED]>
>To: 
>Sent: Thursday, July 28, 2005 3:36 PM
>Subject: Re: [flexcoders] sound problem: onSoundComplete
>
>
>
>WARNING: The remainder of this message has not been transferred.
>The estimated size of this message is 41981 bytes.
>Click on the Retrieve From Server icon above and check mail again to get 
>the whole thing. (If you're reading this in the preview pane, you'll need 
>to open the message to see the icon.)  If the Retrieve From Server icon is 
>not showing, then this message is no longer on the server.



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




Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread Tom Fitzpatrick
Hey - thanks Jeff and Jester.

Another difference between Jeff's code and mine is that his uses the 
delegate to play the sound as well as to call the onSoundComplete method.

I was curious why snd.start() was called twice. I removed the snd.start() 
call in the startSound() function and it worked - but the sound would not 
repeat (I added a button to repeatedly play the sound, instead of making it 
an initialization event). Adding the snd.start() back in allowed repeating. 
Not sure why this is the case.

Also curious what performance difference - if any - there is between 
embedded and non-embedded sounds. I was able to get it to work both ways.

Thanks again.

- Tom


At 03:55 PM 7/28/2005, you wrote:
>As I say, not entirely sure why mine works when the original doesnt, but it
>works, which is good enough for now.
>
>At 03:49 PM 7/28/2005, you wrote:
> >The Activation Object is the weirdest beast... XML & LoadVars will both stay
> >around AND fire their onLoad/onData events even if you declare them as local
> >vars.
> >
> >While this is nice to save on member variables, no one knows what the heck
> >garbage collection does with them, so doing things your way is recommended.
> >
> >...still, I have in the past gotten onSoundComplete to work via a local var
> >so not sure...
> >
> >- Original Message -
> >From: "Jeff Tapper" <[EMAIL PROTECTED]>
> >To: 
> >Sent: Thursday, July 28, 2005 3:36 PM
> >Subject: Re: [flexcoders] sound problem: onSoundComplete
> >
> >
> >
> >WARNING: The remainder of this message has not been transferred.
> >The estimated size of this message is 41981 bytes.
> >Click on the Retrieve From Server icon above and check mail again to get
> >the whole thing. (If you're reading this in the preview pane, you'll need
> >to open the message to see the icon.)  If the Retrieve From Server icon is
> >not showing, then this message is no longer on the server.
>
>
>
>--
>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

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





Re: [flexcoders] sound problem: onSoundComplete

2005-07-28 Thread JesterXL
attachSound I reckon has less overhead because the sound and header are 
already embedded in the SWF.  Additionally, attachSound is a syncronous 
opertion, where as loadSound, both streaming and non, is asyncronous.

attachSound requires a sound asset be embeded in your SWF, increasing 
compile time, final SWF size, and loading overhead.  As such, the sound is 
immediaetly available first frame.

loadSound requires the external file be mp3 only where as attachSound allows 
you to import a wide array of formats, with at least 3 different codecs to 
choose from.

loadSound can load mp3's from dynamic sources as well where as attachSound 
is harcoded to internal assets (like 
http://www.server.com/myapp.cfm?getmp3file) vs. a true file.mp3.

loadSound can undocumented connect to SHOUTCast/streaming mp3 servers.

I use attachSound for button clicks and other UI sounds; quick, short.

I use loadSound for background music, and long voice overs (if I don't care 
about syncronization, or have code to handle that for me).

- Original Message - 
From: "Tom Fitzpatrick" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, July 28, 2005 4:50 PM
Subject: Re: [flexcoders] sound problem: onSoundComplete


Hey - thanks Jeff and Jester.

Another difference between Jeff's code and mine is that his uses the
delegate to play the sound as well as to call the onSoundComplete method.

I was curious why snd.start() was called twice. I removed the snd.start()
call in the startSound() function and it worked - but the sound would not
repeat (I added a button to repeatedly play the sound, instead of making it
an initialization event). Adding the snd.start() back in allowed repeating.
Not sure why this is the case.

Also curious what performance difference - if any - there is between
embedded and non-embedded sounds. I was able to get it to work both ways.

Thanks again.

- Tom


At 03:55 PM 7/28/2005, you wrote:
>As I say, not entirely sure why mine works when the original doesnt, but it
>works, which is good enough for now.
>
>At 03:49 PM 7/28/2005, you wrote:
> >The Activation Object is the weirdest beast... XML & LoadVars will both 
> >stay
> >around AND fire their onLoad/onData events even if you declare them as 
> >local
> >vars.
> >
> >While this is nice to save on member variables, no one knows what the 
> >heck
> >garbage collection does with them, so doing things your way is 
> >recommended.
> >
> >...still, I have in the past gotten onSoundComplete to work via a local 
> >var
> >so not sure...
> >
> >- Original Message -
> >From: "Jeff Tapper" <[EMAIL PROTECTED]>
> >To: 
> >Sent: Thursday, July 28, 2005 3:36 PM
> >Subject: Re: [flexcoders] sound problem: onSoundComplete
> >
> >
> >
> >WARNING: The remainder of this message has not been transferred.
> >The estimated size of this message is 41981 bytes.
> >Click on the Retrieve From Server icon above and check mail again to get
> >the whole thing. (If you're reading this in the preview pane, you'll need
> >to open the message to see the icon.)  If the Retrieve From Server icon 
> >is
> >not showing, then this message is no longer on the server.
>
>
>
>--
>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

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




RE: [flexcoders] sound problem: onSoundComplete

2005-07-29 Thread Dirk Eismann
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.

RE: [flexcoders] sound problem: onSoundComplete

2005-07-29 Thread Tom Fitzpatrick
At 08:29 AM 7/29/2005, you wrote:
>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 - thanks. I finally got it working with help from you and others. I'm 
still not sure why my first version didn't work, but everything's ok now.

Just curious - is the code for your SoundManager class available?

- Tom 





 Yahoo! Groups Sponsor ~--> 
http://us.ard.yahoo.com/SIG=12hb9bask/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122661587/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.
~-> 

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