Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-24-2004, 03:49 AM   #1
HBB Alfred
Registered User
 
Join Date: May 2004
Posts: 44
Default problem of stopAllSound

hello everybody
i open two swfs have play sound in browser at the same time.
one of both have a button which has code
on(release){stopAllSound();}

and then i pressed the button,another swf's sound was stop too

i don't know what was happend in flash and how can i stop the swf sound of focus browser
HBB Alfred is offline   Reply With Quote
Old 09-24-2004, 04:06 AM   #2
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

PHP Code:
var your_sound = new Sound()
your_sound.attachSound("your sound")

on(release) {
      
your_sound.stop()

That will stop only one sound, not all of them

Eric
__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Old 09-24-2004, 04:09 AM   #3
HBB Alfred
Registered User
 
Join Date: May 2004
Posts: 44
Default

oh...thanks for you reply

and then can you tell me what was happned in flash while the event above
HBB Alfred is offline   Reply With Quote
Old 09-24-2004, 04:28 AM   #4
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

Quote:
and then can you tell me what was happned in flash while the event above
stopAllSounds() does exactly as it says, it stops all sounds from playing, so no matter where you put it, it will stop everything from playing

Eric
__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Old 09-24-2004, 04:33 AM   #5
HBB Alfred
Registered User
 
Join Date: May 2004
Posts: 44
Default

i have done your method but it is no use
two swfs sound still have stop at same time
HBB Alfred is offline   Reply With Quote
Old 09-24-2004, 05:32 AM   #6
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Quote:
Originally Posted by mmm..pi..3.14..
PHP Code:
var your_sound = new Sound()
your_sound.attachSound("your sound")

on(release) {
      
your_sound.stop()

That will stop only one sound, not all of them

Eric
Because of the way it's coded, that would stop all sounds also...

Check http://www.kennybellew.com/tutorial/

How to Control Independent Sound Objects Simultaneously
oldnewbie is offline   Reply With Quote
Old 09-24-2004, 05:49 AM   #7
HBB Alfred
Registered User
 
Join Date: May 2004
Posts: 44
Default

thank you old newbie
i understand it
but my problem is why the swf use stopAllSoud then another sound can stop in browser??
the thing doesnot happend in flashplayer
HBB Alfred is offline   Reply With Quote
Old 09-24-2004, 06:09 AM   #8
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

Whoops, oldNewbie is right, forgot about that...

This works though...

PHP Code:
is_playing true
_root
.createEmptyMovieClip("sound1"1)
_root.createEmptyMovieClip("sound2"2)
//sound 1
var your_sound1 = new Sound(sound1);
your_sound1.attachSound("sound1");
your_sound1.start();
//sound 2
var your_sound2 = new Sound(sound2);
your_sound2.attachSound("sound2");
your_sound2.start(); 
and on your buttons, this will turn the sound on and off...

PHP Code:
on (release) {
    
is_playing = !is_playing;
    if (
is_playing == true) {
        
sound1.stop();
    } else {
        
sound1.start();
    }

__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:55 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.