Re: [Flashcoders] AS2 Sound.stop()
Thanks Arul, and Ian. This is very helpful! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2 Sound.stop()
Hello :) I use in my opensource framework a model to register all sounds in my application and manipulate all sounds. The SoundLibrary class : http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/andromeda/media/SoundLibrary.as See the example of the class : import andromeda.events.SoundModelEvent ; import andromeda.media.SoundLibrary ; import vegas.events.Delegate ; var debug:Function = function ( e:SoundModelEvent ):Void { var type:String = e.getType() ; var id:String = e.getID() ; var library:SoundLibrary = SoundLibrary(e.getModel()) ; var sound:Sound = e.getSound() ; var message:String = + library ; message += + type ; if (id != null) { message += , id: + id ; } if (sound != null) { message += , sound: + sound ; } trace( message ) ; } var lib:SoundLibrary = new SoundLibrary() ; lib.addGlobalEventListener( new Delegate(this, debug) ) ; lib.addSound( sound_1 ) ; // sound_1 is the link name of the sound in the library lib.addSound( sound_2 ) ; // lib.addSounds( [sound_1, sound_2] ) ; // use this method to register a array collection of sounds ids. trace( + lib + size : + lib.size()) ; Key.addListener(this) ; var onKeyDown:Function = function() { var code:Number = Key.getCode() ; switch ( code ) { case Key.UP : { lib.getSound( sound_1 ).start() ; break ; } case Key.DOWN : { lib.getSound( sound_2 ).start() ; break ; } case Key.SPACE : { lib.toggle() ; // enable/disable all sounds break ; } } } trace( Press Key.SPACE to disable/enable the library.) ; trace( Press Key.UP to start the sound_1 sound.) ; trace( Press Key.DOWN to start the sound_2 sound.) ; See the online documentation : http://vegas.ekameleon.net/docs/andromeda/media/SoundLibrary.html Page project : http://code.google.com/p/vegas/ Install VEGAS with this SVN repository in osFlash : http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN EKA+ :) 2007/9/12, Ian Thomas [EMAIL PROTECTED]: Each Sound() object is attached to a particular timeline. So if you do : (new Sound(_root)).stop() everything from _root downwards should stop. HTH, Ian On 9/11/07, Andrew Sinning [EMAIL PROTECTED] wrote: I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] AS2 Sound.stop()
Hi Andrew, So, how do you stop all currently playing sounds? If that is literally what you want to do, have you looked at the global function stopAllSounds()? Regards, -Keith http://keithreinfeld.home.comcast.net ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] AS2 Sound.stop()
I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2 Sound.stop()
Each Sound() object is attached to a particular timeline. So if you do : (new Sound(_root)).stop() everything from _root downwards should stop. HTH, Ian On 9/11/07, Andrew Sinning [EMAIL PROTECTED] wrote: I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2 Sound.stop()
If you had the sound imported into your library, assigned a linkage ID, and then attached it using Sound class's attachSound method, you'd have a 'idName'. If you loaded your audio clip using loadSound method, you wouldn't have a linkageID. So don't worry abt it. Sound has no static field stop. 'coz, as the error message states, there is no static method called 'stop' in the Sound class. You should've called stop() on ur Sound class object - my_sound. - my_sound.stop() -- Arul Prasad http://arulprasad.blogspot.com On 9/12/07, Andrew Sinning [EMAIL PROTECTED] wrote: I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com