|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
disable a sound
is thsi possible?
I have movieA which contains a sound, the movieA loops itself, so the sound emits everytime it loops. I have a mute button. they are both on the same timeline. How do I get the button to mute only the audio part of the movieA. I tried the action "stop all sounds" on the button. But it only mutes it on one loop only, then it emits again. Do I have to make the sound into a movie instance, place it in the movieA, and disable that "sound movie" that contains the sound, so atleast the movie still loops but not the sound movie. There must be an easier way than that. I also have somewhere in this forum, a question about disabling and enabling buttons. Can someone answer that for me please : ) TIA
__________________
INE-Kpro... (eye-yen-kay pro) http://www.INE-Kpro.com enquiries@INE-Kpro.com <--- watch this space ---> |
|
#2
|
|||
|
|||
|
hello, i'm assuming you dragged the sound out of your library and placed it on the timeline? sounds brought in like this are a lot harder to control then sounds instantiated with code. What you could do is keyframe out your sound movieClip. Have the first frame be blank, then a keyframe, then a frame with your sound on it. Then, when you need to pause the sound, just tell that movieclip to gotoAndStop the blank frame, when you need it to start it again, go to the frame with the sound.
like i said, it's easier to do with code tho: Code:
mySound = new Sound(this);
mySound.attachSound("soundFX");
mySound.start(0,99);
This will loop a sound 99 times with a 0 second offset. And to stop it, just reference the sound: Code:
mySound.stop(); The "soundFX" is what's called a linkage name. Simply right click on your sound in the library, click "linkage" and type in the name. This is the name that you will use to "attach" it. So, theoretically, my sound has a linkage name (or id) of "soundFX". hope that helps. -bret |
|
#3
|
|||
|
|||
|
I like the idea of that code. But I need to have the sound emit with the loop, because it syncs with the loop.
having it emit up to 99 times would mean it would emit sound anytime, which would not look co-ordinated with the movie loop. and yes I did drag the sound from the library. Now with that emit sound code, could I have it set to emit sound once, let it emit everytime that frame is hit during the loop. And have a button disable that frame or sound. Or can disable only occur on movies and buttons, but not frames, or sound. That sound disable thing, will that disable sound permanently unless activated. or will it activate again, once the frame that contains the sound is hit in a loop. eg. movieA contains: frame 2 = sound1 frame 3 = goto frame 1 Now I have the button disable the sound Will that sound stop, regardless of whether it is looped over. Now I use a button to enable it again, and will that work. When a movie reloads again, are all settings reseted, or will it remember that the sound was disabled from before? TIA |
|
#4
|
|||
|
|||
|
yes, you can control this sound however you want, with frame actions, or event actions (on release of a button or whatever)
any time you said mySound.stop(); it would stop. and any time you said mySound.start(0,1); it would play through once. If you tell it to stop in the middle of playing, it will do so...otherwise, the sound will act independent of whatever frame you intialised it on... -bret |
|
#5
|
|||
|
|||
|
so what would happen if you have like 2 sounds that you want controlled, how do u differentiate the 2.
would it be mySound = new Sound(this); mySound.attachSound("soundFX"); mySound.start(0,99); thats for sound 1 and for sound2, it would be mySound2 = new Sound(this); mySound2.attachSound("soundFX"); mySound2.start(0,99); or mySoundB = new Sound(this); mySoundB.attachSound("soundFX"); mySoundB.start(0,99); is that how it works, and so on, and then you just command the mysound part to whichever sound your refering to that you would like stopped? TIA |
|
#6
|
||||
|
||||
|
That's looks to be correct. As long as they have different variables the program will be able to control one at a time.
__________________
- Infinityws.com - Providing Reliable Web Hosting Solutions Since 2000 - Web Hosting - Reseller Accounts - E-Commerce Packages - Free ClientExec License With ALL Reseller Accounts A Satisfied Customer
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > disable a sound |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|