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: <flexcoders@yahoogroups.com> 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: <flexcoders@yahoogroups.com> > >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/