[Flashcoders] as3 sound and swf overriding one another
Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
Hi Glen, I know I need to invoke the stop method to stop a sound object but what I am looking for is to have my mp3 and the sound in the swf playing at the same time. what is happening at the moment is that the sound in the swf overrides the mp3 soundchannel and therefore causes the mp3 to stop without me calling the stop method. thanks On Tue, May 6, 2008 at 1:38 PM, Glen Pike [EMAIL PROTECTED] wrote: Hi, If you want to stop the Embedded sound playing you need to save the SoundChannel object returned from calling play() on the Sound object: I guess you need to call stop() on your sound channel when your SWF loads. Here is a snippet of my code for a game - I stored my sound assets in a single object, in which I also put any SoundChannel objects that I had for looping sounds or sounds I wanted to stop / manipulate: [Embed (source = ../resources/graphics.swf, symbol=MotherShip)] private var MotherShip:Class; _sounds = new Object(); _sounds.mothership = new SndMotherShip() as SoundAsset; _sounds.mothership_stop = _sounds.mothership.play(0, 100) as SoundChannel; //trace(showMotherShip + _sounds.mothership_stop); var pan:Number = ( _motherShip.x / _width) - 0.5; SoundChannel(_sounds.mothership_stop).soundTransform = new SoundTransform(1, pan); HTH Glen quinrou . wrote: Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
Apologies, I misunderstood what you wanted to do. If you google around for sound and embedded flv people seem to be having a few problems so I am guessing this may be a bigger issue and would not surprise me if there is a bug in there somewhere or maybe a feature of the player. I had one a while ago where calling stopallsounds stopped all sounds, across every browser tab - f*g annoying if you are listening to internet radio or similar. Sorry I can't be any more help... Glen quinrou . wrote: Hi Glen, I know I need to invoke the stop method to stop a sound object but what I am looking for is to have my mp3 and the sound in the swf playing at the same time. what is happening at the moment is that the sound in the swf overrides the mp3 soundchannel and therefore causes the mp3 to stop without me calling the stop method. thanks On Tue, May 6, 2008 at 1:38 PM, Glen Pike [EMAIL PROTECTED] wrote: Hi, If you want to stop the Embedded sound playing you need to save the SoundChannel object returned from calling play() on the Sound object: I guess you need to call stop() on your sound channel when your SWF loads. Here is a snippet of my code for a game - I stored my sound assets in a single object, in which I also put any SoundChannel objects that I had for looping sounds or sounds I wanted to stop / manipulate: [Embed (source = ../resources/graphics.swf, symbol=MotherShip)] private var MotherShip:Class; _sounds = new Object(); _sounds.mothership = new SndMotherShip() as SoundAsset; _sounds.mothership_stop = _sounds.mothership.play(0, 100) as SoundChannel; //trace(showMotherShip + _sounds.mothership_stop); var pan:Number = ( _motherShip.x / _width) - 0.5; SoundChannel(_sounds.mothership_stop).soundTransform = new SoundTransform(1, pan); HTH Glen quinrou . wrote: Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
Hi, If you want to stop the Embedded sound playing you need to save the SoundChannel object returned from calling play() on the Sound object: I guess you need to call stop() on your sound channel when your SWF loads. Here is a snippet of my code for a game - I stored my sound assets in a single object, in which I also put any SoundChannel objects that I had for looping sounds or sounds I wanted to stop / manipulate: [Embed (source = ../resources/graphics.swf, symbol=MotherShip)] private var MotherShip:Class; _sounds = new Object(); _sounds.mothership = new SndMotherShip() as SoundAsset; _sounds.mothership_stop = _sounds.mothership.play(0, 100) as SoundChannel; //trace(showMotherShip + _sounds.mothership_stop); var pan:Number = ( _motherShip.x / _width) - 0.5; SoundChannel(_sounds.mothership_stop).soundTransform = new SoundTransform(1, pan); HTH Glen quinrou . wrote: Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
no problem, I think i have sort of managed to locate the bug to when and where it occures My mp3 stops playing everytime a swf gets loaded regardless of it containing a flv or not. this pure madness... thanks On Tue, May 6, 2008 at 2:08 PM, Glen Pike [EMAIL PROTECTED] wrote: Apologies, I misunderstood what you wanted to do. If you google around for sound and embedded flv people seem to be having a few problems so I am guessing this may be a bigger issue and would not surprise me if there is a bug in there somewhere or maybe a feature of the player. I had one a while ago where calling stopallsounds stopped all sounds, across every browser tab - f*g annoying if you are listening to internet radio or similar. Sorry I can't be any more help... Glen quinrou . wrote: Hi Glen, I know I need to invoke the stop method to stop a sound object but what I am looking for is to have my mp3 and the sound in the swf playing at the same time. what is happening at the moment is that the sound in the swf overrides the mp3 soundchannel and therefore causes the mp3 to stop without me calling the stop method. thanks On Tue, May 6, 2008 at 1:38 PM, Glen Pike [EMAIL PROTECTED] wrote: Hi, If you want to stop the Embedded sound playing you need to save the SoundChannel object returned from calling play() on the Sound object: I guess you need to call stop() on your sound channel when your SWF loads. Here is a snippet of my code for a game - I stored my sound assets in a single object, in which I also put any SoundChannel objects that I had for looping sounds or sounds I wanted to stop / manipulate: [Embed (source = ../resources/graphics.swf, symbol=MotherShip)] private var MotherShip:Class; _sounds = new Object(); _sounds.mothership = new SndMotherShip() as SoundAsset; _sounds.mothership_stop = _sounds.mothership.play(0, 100) as SoundChannel; //trace(showMotherShip + _sounds.mothership_stop); var pan:Number = ( _motherShip.x / _width) - 0.5; SoundChannel(_sounds.mothership_stop).soundTransform = new SoundTransform(1, pan); HTH Glen quinrou . wrote: Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] as3 sound and swf overriding one another
the completeHandler is only to re dispatch the channels SOUND_COMPLETE private function completeHandler(event: Event): void { dispatchEvent(new Event(Event.SOUND_COMPLETE)); } The Application (the mp3 player in this case) listens to the SOUND_COMPLETE and then starts a new song, after the new url is taken from the playlist. No fancy stuff there ;) Folkert quinrou . wrote: Sidney, Thanks for this but I think i will need to get the explaination coz the code isn't fully there. i.e. There no method completeHandler which is used in the last example which is i think the one I am the most interested in since it looks very similar to the on I have. Anyone else who has a solution for this problem? thanks On Tue, May 6, 2008 at 12:43 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Quinrou, I have exactly the same with an AIR project i'm building. I have not found a fix, there is an explanation i'm reading right now, it is in dutch, however the code should help you. http://nederflash.nl/blog/as3-tips%3A-error-2029-uitgelegt#comment-42 Hope this helps you, Sidney On May 6, 2008, at 1:22 PM, quinrou . wrote: Hi all, I am having a very strange behavior with the Sound object. I will try to describe the problem as accurate as possible. I have a mp3 which I have embedded in class like this [Embed(source='../../../../../embedded_assets/mp3/loop.mp3')] private var Loop:Class; This mp3 plays when the application starts and keeps on looping. However as soon as a swf with an embedded flv on the timeline (which also contains sound) starts playing the mp3 then stops playing. there's no code which tell mp3 to stop playing when the swf starts... It looks like the swf overrides the mp3 sound channel. Has anyone experienced behavior and how did ou manage to fix the problem. Many thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders