Help - Problem With Multiple Sounds W/buttons
hi....
im making a page with multiple buttons on the page and each one has a distinctive sound that comes out of it when pressed and different graphics on the roll over. My problem is when you press multiple buttons at the same time it doesnt cut the other sound off. whatever buttons you press they will play at the same time and not cut the other one off. Please help if anyone knows what to do about this. THANK YOU Scott the_dook@iamwasted.com
FlashKit > Flash Help > Flash MX
Posted on: 06-18-2003, 03:28 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Buttons With Multiple Sounds
Flash 5: I have a button. I have 3 sounds that I would like to be randomly played when that button is clicked on. Is there a script or even an easier way to do this? In other words, I have 3 different sounds that I would like to be played when the button is clicked, seperatelt of course. Any suggestions?
Sounds/Multiple Buttons (easy?)
How do I stop multiple sound buttons from overlapping
Each button has a different sound
I inserted each sound in the down state of each button
How do I prevent several sounds from playing at once?
Thanx -Mel
http://www.med.wayne.edu/gradprog/vi...rtualtour.html
sounds are at the bottom of the page
(soundbytes)
click on two buttons at once and get the tower of babel
[Edited by Mwencel on 10-22-2001 at 12:36 PM]
Buttons Playing Multiple Sounds?
Hi everyone, I am pretty new to all of this, but here is what I am trying to do. I want a single button to play a different sound file each time it is pressed, and then start back over again. So if I have three sounds, the first button press plays sound one, second press sound two, third press sound three, fourth press sound one again etc.
I am sure that this is probably easier than I am making it, but I just can't seem to figure a way to do this. If anyone has any ideas I would be most happy.
Thanks, John
Multiple Sounds In Sync, Controlled By Buttons?
Hi,
What i'm aiming to do is make a very simple "DJ" game where a user can start music clips (that have been made the same tempo previously).
Here is the design of the game:
http://img228.imageshack.us/img228/7729/playerlg8.jpg
Basically the user clicks a button, music plays, the he/she can choose another clip on the other side and that should start but play in sync.
(So maybe the clips are just muted?)
Then, i'd like for the crossfader to work, so he/she can cut between or slow fade from one side to the other.
I'm not very competant with flash so please be gentle.
Many many thanks!
Rand Generate Sounds Multiple-sounds
I got background sound playing (looped) in a movieclip. How could I randomly play other sounds while the background sound is playing? No mouse actions involved here. My objective is to play other sounds while bgsound is playing at any given time or specific times.
Example: playing looped sound and have a short sound clip play when the looped bgsounds hits 20th loop.
Dunno if this is even possible, but hopefully someone can explain how and show a example. thx
Multiple Sounds, Multiple Frustrations
Hey all,
I haven't gotten any responses to my previous sound questions, but I assume that is because the answer is obvious and I should know better. However, I am still struggling. I have a few basic questions that make up my lack of understanding of sound in flash. An example is... I have a narrator reading off questions of a quiz. The first time I create the sound object "narrationSound", I have him read an intro. Next, it needs to move on to the first question, etc. I try to detect when the sound ends by using onSoundComplete, which works once it seems. I do use the same sound ID for the next sound, so perhaps I am not deleting the first one properly. I don't want to create a new sound ID for every sound, because the sounds are played on the fly, and could come up in any order. It would be hard to keep checking for the end of every sound, even if only one of 50 were playing. I pasted some code in an earlier post, but have since been changing mine to try different stuff. I think there is an overall understanding of how sound works that I just don't have. I come from Director where you can assign sounds to a sound channel, and when you replace the sound in the channel with a new one, the old one stops and new one starts. So you could control narration by just dealing with one sound channel. I would like to try to do this on some level with the sound ID. Any thoughts?
Multiple Sounds
Hey guys,
I have two buttons controlling each their sound at the same time, but when I turn one of them off, it automatically turns the other off too; even though I have assigned different names for each sound.
I am using this script for one of the buttons, with the "voice" label changed to "ambience" for the second button:
voice = new Sound();
voice.attachSound("voice");
voice.setVolume(0);
voice.start(0, 50000);
... I use "voice.setVolume(0);" when I turn 'off' the sound on the first button and "voice.setVolume(100)" to turn it 'on' again. For the second button I use "ambience.setVolume(0);" and "ambience.setVolume(100);" ...
Anyone who can help me figure out why they control eachother?
Thanks!
:: serviator
Multiple Sounds
i have 5 links
Rock
Pop
Country
Jazz
Funk
and each one should play a different sound. eg.
Rock - plays rock.mp3
Pop - plays pop.mp3
Country - plays country.mp3
Jazz - plays jazz.mp3
Funk - plays funk.mp3
What actions do i give the buttons/frames/MCs?
I know that my stop button needs stopallsounds but i dunno about the playing bit!
Help With Multiple Sounds..its Odd This One
In my movie clip I have a "static" sound attached to the static movie clip. The static movie clip is present in 3 of my scenes. However in scene 3, when the "beep" sound starts, the volume of the sound in the static movie clip gets much louder. Is there anyway to have 2 sounds play without this increase in volume?
Multiple Sounds
so i have a main movie inside a mc named content and i attach a sound that will loop:
in 1st frame i attach it like this:
mySound = new Sound(this);
mySound.attachSound("loop");
mySound.setVolume(100);
mySound.start(0,9999);
one swf that will load later i want to remove this sound (better set the volume to "0" cause it'll continue later)
i do it like this:
_level0.content.mySound.setVolume(0);
when i'll return to my main movie i set the volume again to 100
mySound.setVolume(100);
everything works gr8 but i need to attach more sounds to the main movie so with the same way i can control them later through swfs
i tried this:
mySound = new Sound(this);
mySound.attachSound("loop");
mySound.setVolume(100);
mySound.start(0,9999);
bSound = new Sound(this);
bSound.attachSound("loop_2");
bSound.setVolume(0);
bSound.start(0,9999); (i want it to start in mute cause i;ll control it later)
but it doesn't work ,it sets the mysound volume also to 0
if i was able to do this then through the swf i would done the same as with 1 sound:
_level0.content.mySound.setVolume(0);
_level0.content.bSound.setVolume(100);
what is the correct AS to load multiple sounds and control them through swfs that will load in level or mcs?
thank you
Multiple Sounds
well, ive been trying to get a sound area working on my site. currently everything works fine except when i try to load another song into it.
code:
function loadmix(mix, track) {
_root.audio.loadSound(mix+".mp3", false);
_root.loaded = _root.audio.getBytesLoaded();
_root.total = _root.audio.getBytesTotal();
_root.loader = ((_root.loaded/_root.total)*100);
_root.inload_bar._width = _root.loader;
_root.scroll_text = "Now loading "+track+" by Alpha Trax";
if (_root.inload_bar._width == 100) {
_root.audio.start;
_root.scroll_text = "Now playing "+track+" by Alpha Trax";
}
}
this is after i attached a song to audio in the begining of the file, this function gets activated at the completion of the first song. so far it changes the scroll_text properly but does not load the new song. yes ive tested to make sure the song is compatible. it just fails to start loading it, if anyone can help that would be nice, if you need more info just ask
Multiple Key Sounds Mix
I am trying to have two or more keys on a keyboard, each playing a different music sample when pressed. when pressed for the second time i want the sample to stop but only for the key pressed. (not all of them)
Using the code below i have put each music sample in a new movie clip attached to a different key. I can get the samples to play at the same time, but when i hit a key for the second time to turn the sample off - both of the samples stop instead of the one of the key i press.
i am really stuck with this one and any help would be much appreciated
Thanks
CODE IM USING:-
loop = new Sound();
loop.attachSound("drums");
var keyToListenFor:Number = 32; // space bar
var keyListener:Object = new Object();
keyListener.onKeyDown = function():Void
{
trace( "Key = " + Key.getCode() );
if( Key.getCode() == keyToListenFor )
{
if( isPlaying == true )
{
loop.stop();
isPlaying = false;
}
else
{
loop.start();
isPlaying = true;
}
}
};
Key.addListener( keyListener );
(If there is an alternative method to using this code please let me know. Cheers)
Multiple Sounds
Hey all.
Im new to flash. Im using both Flash 5 and Flash MX.
My problem is, I would like different sounds on different buttons, but after doing this, my buttons all make the same sound. What am I doing wrong and please help.
Thanks
Multiple Sounds At Once
Hello everyone, once again I am running into an issue with my game. Currently, I have a sound imported into the library called deagleSound.mp3. I have it exported for AS using a class called deagleSound.
I added this code to the gun firing function:
var tmpSound:deagleSound = new deagleSound();
tmpSound.play();
This works fine and dandy, except for one issue. The gun fires faster than the length of the mp3. I want flash to simply play ANOTHER deagleSound, so there are two going at once. Instead what I get is I have to wait for the sound to finish before it plays again, essentially leaving some bullets soundless. Anyone have any ideas?
Controlling Multiple Sounds
Hi people!
I want to change the volume of just one sound.
Here is what I got:
Code:
click = new Sound();
lightclick = new Sound();
slide = new Sound();
click.attachSound("click");
slide.attachSound("slide");
lightclick.attachSound("click");
lightclick.setVolume (20);
This is changing the volume for all sounds not just lightclick. What wrong?
Thanks,
Liquid Genius
http://www.316video.com/John/liquid
Controlling Multiple Sounds...
Hi,
I have a movie with seven buttons on it.
Three of the buttons control a piece of video (reveals and starts it). The other four buttons reveal static movies.
When any of the four static movies are shown, an audio loop plays in the background. The videos have their own sound.
I need the background loop to stop when any of the videos are showing and then start when any of the static movies are playing.
I've tried a Sound object for the loop and then starting and stopping it depending on which button is clicked, but it seems to start and stop the sound in the videos too.
Can anyone help?
Thanks,
Phil
Trigger Multiple Sounds With MCs
hi,
my problem - im trying to create a virtual piano with 48 keys
the instances of the keys are movieclips named: b0 - b48
the library sounds are named: ton0 - ton48
i want to make the MCs play the right sound on pressing them and a little animation on pressing them (changing the MC frame from 1 to 3)
here my code:
Code:
function anfang() {
for (i=0; i<49; i++) {
taste = "b"+i;
toene = "ton"+i;
sobj = "sobj"+i;
sobj = new Sound(taste);
sobj.attachSound(toene);
sobj.setVolume(100);
//sobj.start(0, 1);
this.taste.stop();
this.taste.onPress = function() {
sobj.start(0,1);
taste.gotoAndStop(3);
}
this.taste.onRelease = function() {
taste.gotoAndStop(1);
}
}
}
anfang();
please help me ... and keep it simple
Newbee Needs Help With Multiple Sounds
Im trying to make a movie with one sound continuously playing in the background, and then a second sound in the foreground. How do I code the buttons to stop one sound but not the other?
Thanks,
Simon aka theanimal
Help Please With Stopping Multiple Sounds
Hi all! I am new when it comes to controlling sounds in Flash MX.... and i have this very short flash header for a web site. There are 2 main sounds that occur in different frames in the movie and i was trying to create a button to turn All the sounds off at once....
When i create a button with the behavior stop all sounds.... one sound stops, but the rest keep playing...
Any ideas how i can stop them all?
Thanks
Multiple Sounds And 1 Variable
I'm having an issue with trying to pass sound data to a variable. Can someone just look at this code and tell me what I'm doing wrong?
Code:
//set narration variable
var narration:Sound = new Sound();
//set sound ID
intro = new Sound(this);
intro.attachSound("intro");
narration = _root.intro();
narration.start();
Why isn't my narration variable getting the data and playing the intro sound?
Attach Multiple Sounds
Hi.I went through all 170 or so links for attach sound search.But can't quite get what I want.I need 3 individual sounds to play on a frame.I found this function but can't get it to work with three sounds.
[a]
stop()
function mysound(){
mysoundobj=new Sound(this)
mysoundobj.attachSound(idname)
mysoundobj.start()
}
[/a]
I got it to work with one sound though.
Heres what i had trying to get three sounds
[a]
function mysound(){
mysoundobj=new Sound(this)
mysoundobj.attachSound("boom","bam","bang")
mysoundobj.start()
}
[/a]
then I called it on the frame with
mysound()
no work
HELP With -Multiple Keys With Different Sounds
I am trying to have two or more keys on a keyboard, each playing a different music sample when pressed. when pressed for the second time i want the sample to stop but only for the key pressed. (not all of them)
Using the code below i have put each music sample in a new movie clip attached to a different key. I can get the samples to play at the same time, but when i hit a key for the second time to turn the sample off - both of the samples stop instead of the one of the key i press.
i am really stuck with this one and any help would be much appreciated
Thanks
CODE IM USING:-
loop = new Sound();
loop.attachSound("drums");
var keyToListenFor:Number = 32; // space bar
var keyListener:Object = new Object();
keyListener.onKeyDown = function():Void
{
trace( "Key = " + Key.getCode() );
if( Key.getCode() == keyToListenFor )
{
if( isPlaying == true )
{
loop.stop();
isPlaying = false;
}
else
{
loop.start();
isPlaying = true;
}
}
};
Key.addListener( keyListener );
(If there is an alternative method to using this code please let me know. Cheers)
Multiple Sounds Issue
I'm having an issue with sound that I guess I never ran into before. Any help is appreciated.
I have a timer running while users select buttons to answer questions. On the buttons I have
Code:
mcBtnTrue.onPress = function(){
btnSound = new Sound();
btnSound.attachSound("sound_btn", true);
btnSound.start(0);
//etc.etc.
}
On my timer movieClip I have
Code:
mcTimer.sndTick = new Sound();
mcTimer.sndTick.attachSound("tick");
then I set an interval to 1000ms to start that sound every second(ish).
This all works fine except if the two sounds collide - if the user presses the button at the same time the timer starts the 'tick' sound will skip.
I swear I've played multiple sounds before, why isn't this working?
Loading Multiple Sounds
Hopefully, I'm just having a brain cramp on this one...
I'm creating multiple sound object, storing them in an array and trying to load mp3s off of a server into each sound object. So I'm doing a loop:
ActionScript Code:
// the following is from a class, so I've simplified a couple of things,
// but the loop is functionally as is the one in my project
var soundsToPlay:Array = new Array();
for (var i:Number = 0; i < sounds.length; i++) {
var soundObj:Sound = new Sound();
soundObj.onLoad = function(success:Boolean) {
if (success) {
trace(soundObj.duration + ": sound " + i + " loaded");
} else {
trace("sound failed to load");
}
}
// sounds is initialized earlier with paths to the mp3s on a server
trace(sounds[i]); // this returns a legitimate path to the expected sound
soundObj.loadSound(sounds[i], false);
soundsToPlay.push(soundObj);
}
What happens is that the trace in the if (success) conditional returns:
ActionScript Code:
0: sound 9 loaded
0: sound 9 loaded
0: sound 9 loaded
0: sound 9 loaded
0: sound 9 loaded
60526: sound 9 loaded
60526: sound 9 loaded
60526: sound 9 loaded
60526: sound 9 loaded
I'm loading 9 sounds. I'm actually succeeding in getting my sounds loaded as they should be. But why does my trace always reflect the same iterator (which is array.length + 1, the iteration AFTER I've been through the loop already) in my loop instead of for each separate sound that I'm loading?
Another thing is that my sound files are pretty big, pushing 1MB. But the traces are coming almost instantaneously. That doesn't seem right. Maybe they're now cached, but they weren't the first time around and the traces came just as quickly then.
Also, I'm not creating a movieclip for each of the sounds. I'll never be playing more than one at a time. Should I be linking the sounds to movieclips?
Thoughts, anyone?
Controlling Multiple Sounds
I have a web page that displays the tracks from a CD. For each track, there is a link to a flash player swf that loads an MP3.
My player swf has two frames. A stop mp3 frame and a play mp3 frame. There is a button in each frame.
The stop frame has "stopAllSounds();
Here's the code on the play mp3 frame
Code:
stop();
var trackNum = sentNum;
var myPath = sentPath;
track = new Sound ();
track.loadSound("images/media/cd/" + myPath + "/track" + trackNum + ".mp3", true);
track.onSoundComplete = function() {
gotoAndStop("stop");
}
My question is:
If a user clicks play on several tracks simultaneously, how can I have only the last track play?
thanks
Prevent Multiple Sounds
trying to have a sound when i mouseover a movieclip
ActionScript Code:
movieclip.onRollOver = function()
{
_root.playSound("sound1");
}
function playSound(soundName)
{
_root.thisSound = new Sound();
_root.thisSound.attachSound(soundName);
_root.thisSound.start();
}
so i have two problems. one, this method described above cause the sound to repeat itself on top of each other (like a big echo). in other words, as long the mouse is on the movieclip, it keeps adding sounds.
so i tried to detect if the sound existed already, and if it did -- don't play it (that didn't work). i tried to just stop the sound at the start of the function, pretending that it existed, but then no sound plays until i mouseout.
suggestions?
Multiple Sounds Volume (help Plz)
I have read tuorials about how to put sounds into flash, and I need two sounds in my document. I need one to be softer (like backround music) and the other louder). I don't need something to control it in the document, they just need to be preset and stay that way. Thx for any help.
Issues With Multiple Sounds
Hi There,
I'm working on a project in which sound plays an important part.
I want to be able to adjust the volume of two sounds independently, ánd have access to the position in the soundfile.
The code below plays 2 soundfiles ("L36 Bass.wav" & "L36 Perc.wav"). The sounds are declared as 'new Sound' with qualifiers
("L36Bass" and "L36Perc" recpectively) in line 03 & 04 within empty movieclips, to allow individual volume-adjustments.
The volume-mix between the 2 is then governed by the x-mouse position (line 10 - 16):
01 this.createEmptyMovieClip("L36Bass", 1)
02 this.createEmptyMovieClip("L36Perc", 2)
03 SndBass = new Sound("L36Bass")
04 SndPerc = new Sound("L36Perc");
05 SndBass.attachSound("L36 Bass.wav");
06 SndPerc.attachSound("L36 Perc.wav");
07 SndBass.start()
08 SndPerc.start();
09 this.onEnterFrame = function ()
10 { onMouseMove = function ()
11 { xf = _root._xmouse / Stage.width;
12 if ( xf > 0.5 )
13 { volBass = 100; volPerc = 200 * ( 1 - xf ) }
14 else
15 { volPerc = 100; volBass = 200 * xf }
16 SndBass.setVolume(vBass); SndPerc.setVolume(vPerc);
17 }
18 SndBass.onSoundComplete = function()
19 { SndBass.start(); SndPerc.start(); }
20 }
This works just fine (as long as the WAV-files are in the library and the option 'Export for Actionscript' is selected).
However, when I try to access the position within a soundfile with the statement
SndBass.position;
this results in an 'undefined-error'.
When I remove the qualifier in line 03, and go for 'SndBass = new Sound()' in stead of 'SndBass = new Sound("L36Bass")', the property SndBass.position is available, but, as expected, the individual volume-control is lost.
Any suggestons?
Control Multiple Sounds
I have several different sounds on one page, (which are spoken definitions of words) attached to buttons. All work fine, but if the user clicks on one button, then another, both sounds run at once.
How else can I control these sounds, so that only one plays at a time.
I really would appreciate some help, possibly some actionscript would do it, but unfortunately I don't know how to do that.
Sync Multiple Sounds
Hi,
I'm working on an application where I need to play 2 mp3 file simultaneously in sync.
The files play in sync. There is an intermittent problem though. Every once in a while, with no pattern that I can see, the sounds play out of sync.
This happens
> during playing
>after a pause/play operation
I read up on the adobe bugs site and the issue does seem seem to be listed but not fixed.
http://bugs.adobe.com/jira/browse/FP-82
Also the bug is listed for version 9_0_115_0 but I've tried it in 9_0_123 and 10 and the problem still persists.
Would anybody know of a workaround to get to mp3 files to "always" play in sync
AS2 And CS3 Multiple Sounds Playing
This is my first time posting...had to read through a bit first. Would anyone with more experience controlling sounds using AS2 have advice to offer? I will try explain my situation:
I end up with sounds that won't shut off in previous loaded .swf. Or the main theme song doubling on itself. Example: If the Family Reunions Button is the first button clicked, the mainThemeSong plays on top of itself. How do I stop this problem? (If it is played after another button it is ok.) Here is my code on the sub menu buttons of the HOME button (comments detail the problem):
Code:
_root.mainMovie_mc.menu_mc.homeSub_mc.familyReunions_btn.onRelease = function() {
Code:
homePlaceholder._visible = true;
_root.mainMovie_mc.homePic_mc._visible = false;
_root.mainMovie_mc.award_btn._visible = false;
_root.mainMovie_mc.pages._visible = true;
_root.mainMovie_mc.gall.pics.pics._visible = false;
_root.mainMovie_mc.gall.pics._visible = false;
_root.mainMovie_mc.homeMessages_mc._visible = false;
_root.mainMovie_mc.seasonalEffect_mc._visible = false;
_root.mainMovie_mc.seasonalEffect2_mc._visible = false;
_root.mainMovie_mc.developingScroll_mc._visible = false;
_root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;
loadMovie("Construction.swf", "homePlaceholder");
//MainThemePaino is paused; position stored, and restarts correctly IF another button is played first
//MainThemePaino song starts on top of itself and two copies of the song are playing IF it is the first button pressed
//Sound is not playing and has not been paused
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.start(0,999);
}
//Sound has been paused
if (paused == true) {
playing = true;
paused = false;
stopped = false;
_root.mainMovie_mc.themeSong.start(themeSongPosition,0);
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.onSoundComplete = function() {
_root.mainMovie_mc.themeSong.start("MainThemePaino");
};
}
}
};
_root.mainMovie_mc.menu_mc.homeSub_mc.mMystry_btn.onRelease = function() {
homePlaceholder._visible = true;
_root.mainMovie_mc.homePic_mc._visible = false;
_root.mainMovie_mc.award_btn._visible = false;
_root.mainMovie_mc.pages._visible = true;
_root.mainMovie_mc.gall.pics.pics._visible = false;
_root.mainMovie_mc.gall.pics._visible = false;
_root.mainMovie_mc.homeMessages_mc._visible = false;
_root.mainMovie_mc.seasonalEffect_mc._visible = false;
_root.mainMovie_mc.seasonalEffect2_mc._visible = false;
_root.mainMovie_mc.developingScroll_mc._visible = false;
_root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;
themeSongPosition = song.position/1000;
if (pause != true) {
playing = false;
paused = true;
stopped = false;
myConditionText = "Paused";
themeSongPosition = _root.mainMovie_mc.themeSong.position/1000;
_root.mainMovie_mc.themeSong.stop("MainThemePaino");
loadMovie("MMystery.swf", "homePlaceholder");
}
};
_root.mainMovie_mc.menu_mc.homeSub_mc.teaParty_btn.onRelease = function() {
homePlaceholder._visible = true;
_root.mainMovie_mc.homePic_mc._visible = false;
_root.mainMovie_mc.award_btn._visible = false;
_root.mainMovie_mc.pages._visible = true;
_root.mainMovie_mc.gall.pics.pics._visible = false;
_root.mainMovie_mc.gall.pics._visible = false;
_root.mainMovie_mc.homeMessages_mc._visible = false;
_root.mainMovie_mc.seasonalEffect_mc._visible = false;
_root.mainMovie_mc.seasonalEffect2_mc._visible = false;
_root.mainMovie_mc.developingScroll_mc._visible = false;
_root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;
loadMovie("Construction.swf", "homePlaceholder");
//MainThemePaino is paused; position stored, and restarts correctly IF another button is played first
//MainThemePaino song starts on top of itself and two copies of the song are playing IF it is the first button pressed
//Sound is not playing and has not been paused
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.start(0,999);
}
//Sound has been paused
if (paused == true) {
playing = true;
paused = false;
stopped = false;
_root.mainMovie_mc.themeSong.start(themeSongPosition,0);
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.onSoundComplete = function() {
_root.mainMovie_mc.themeSong.start("MainThemePaino");
};
}
}
};
_root.mainMovie_mc.menu_mc.homeSub_mc.weddings_btn.onRelease = function() {
homePlaceholder._visible = true;
_root.mainMovie_mc.homePic_mc._visible = false;
_root.mainMovie_mc.award_btn._visible = false;
_root.mainMovie_mc.pages._visible = true;
_root.mainMovie_mc.gall.pics.pics._visible = false;
_root.mainMovie_mc.gall.pics._visible = false;
_root.mainMovie_mc.homeMessages_mc._visible = false;
_root.mainMovie_mc.seasonalEffect_mc._visible = false;
_root.mainMovie_mc.seasonalEffect2_mc._visible = false;
_root.mainMovie_mc.developingScroll_mc._visible = false;
_root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._visible = false;
themeSongPosition = song.position/1000;
if (pause != true) {
playing = false;
paused = true;
stopped = false;
myConditionText = "Paused";
themeSongPosition = _root.mainMovie_mc.themeSong.position/1000;
_root.mainMovie_mc.themeSong.stop("MainThemePaino");
loadMovie("Weddings.swf", "homePlaceholder");
}
};
On a different submenu button -inside the ABOUT main menu, the mainThemePaino song plays, but the sound in a previous loaded .swf continues anoyingly to play. How can correct this problem? (There is no problem if the viewer has used the close button on the imported external .swf, but so often one simply clicks one more button.) Then I have two sounds playing. I prefer not to use stopAllSounds, because the mainThemeSong pause is not correct then. The code here is:
[code]_root.mainMovie_mc.menu_mc.aboutSub_mc.thomasDavis _btn.onRelease = function() {
aboutPlaceholder._visible = true;
_root.mainMovie_mc.homePic_mc._visible = false;
_root.mainMovie_mc.award_btn._visible = false;
_root.mainMovie_mc.gall.pics._visible = false;
_root.mainMovie_mc.gall.pics.pics._visible = false;
_root.mainMovie_mc.homeMessages_mc._visible = false;
_root.mainMovie_mc.seasonalEffect_mc._visible = false;
_root.mainMovie_mc.seasonalEffect2_mc._visible = false;
_root.mainMovie_mc.developingScroll_mc._visible = false;
_root.mainMovie_mc.pages.homePage_mc.bkgdGlow_mc._ visible = false;
loadMovie("WhoIsDavis.swf", "aboutPlaceholder");
//Sound is not playing and has not been paused
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.start(0,999);
}
//Sound has been paused
if (paused == true) {
playing = true;
paused = false;
stopped = false;
_root.mainMovie_mc.themeSong.start(themeSongPositi on,0);
myConditionText = "Playing";
_root.mainMovie_mc.themeSong.onSoundComplete = function() {
_root.mainMovie_mc.themeSong.start("MainThemePaino ");
};
}
}
};
I hope I haven't missed related advice elsewhere on our forum. I am much stumped on this. As a newbie....many, many thanks in advance!
-Jeannie
Stop Multiple Sounds
I have just created a nice little audio bar in flash for my website enabling the user to select between 3 different sounds. However it cam to my attention when i was testing it that when i clicked a different sound the previous one did not stop thereby creating an awful racket. my question...how can prevent this so that no more than one sound is being played at once?
Regards
- Fred Vaux
Multiple Sounds Fading In And Out
hi! I'm trying to work out how I can use a function over again to fade in and out different sounds, sometimes overlapping, so that as one sound is fading out another begins to fade in. I have done the following so that I can call the fades at any time along the timeline:
// initiate sound
music = new Sound();
music.attachSound("solitaire");
music.start(0, 999999);
// set the volume of the sound to zero
music.setVolume(0);
// set a variable named 'vol'
vol = 0;
function callFadeIn() {
inFade = setInterval(fadeIn, 50);
}
function fadeIn() {
// fade the sound in with an increment of 3 in the variable 'vol'
vol += 3;
music.setVolume(vol);
// put an if condition to restrict the increment in volume after it reaches to 100
if (vol>=100) {
clearInterval(inFade);
}
}
function callFadeOut() {
outFade = setInterval(fadeOut, 50);
}
function fadeOut() {
// fade the sound in with an increment of 3 in the variable 'vol'
vol -= 3;
music.setVolume(vol);
// put an if condition to restrict the increment in volume after it reaches to 100
if (vol<=0) {
clearInterval(outFade);
}
}
callFadeIn();
on frame 200 I stop(); and callFadeOut();
two things, how do I pass arguements across the two functions?? and of course will I need to create these sounds in Mcs??
Controling Multiple Sounds
I have 4 sound files that I want to control separately from 4 different buttons in a swf.
my first thought was to write a function that creates the right sound for the button clicked, and just call the function when they click on the button. Easy enough, and it works great.
My problem comes when I want to shut 1 sound off, but not all the sounds. I have tried using the sound objects name.stop(); and even name.setVolume(0); but these seem to effect all the sounds and not just 1.
How do I control the sounds separately, can I use levels with separate swf's for each sound??
Loading Multiple Sounds
Hey everybody,
Im trying to use the loadsound method following the help files in the flash docs and I've tried using kenny bellews tutorial - Preloading Multiple Sounds. The problem I am having with his, is the sounds dont seem to load and play, it seems buggy where you have to press play a few times for it to start, even when the load bar is full. Maybe because Im using Flash 8? Now Im not a proficient Actionscripter so maybe someone can explain it a little better. With the flashdocs I cant seem to find help with "multiple sounds" I only seem to find loading for one sound. Can anyone help me with this? I am trying to load 60 sounds and basically have one loadBar. Basically its a sample song list.
Control Multiple Sounds In Movie?
Hey all ya FLashies,
The problem I'm having is making my volume control be able to control all the sounds in my game.
My game contains 4 scenes whereby each scene is a SWF file. Each one is loaded when the player
clicks on chosen destination located on the Map. What I've created is an MC called "soundMC". Each
frame contains a different sound. What I want to do is each time a new scene is loaded I want the
sound for a specific scene to start playing, but I want the sound to also be controlled by the volume
control.
Can anyone help with this???? All help greatly appeciated and welcomed. (; if u need the FLA plz let me know
Oh by the way I'm using flash MX if that's any help.
Sound: Set Different Volumes For 2 Or Multiple Sounds?
Hello,
Iam searching vor solution so adjust different volumes for multiple sounds.
That means:
Sound1 Volume 100
Sound2 Volume 20
I have tried that with the following script:
DayNature = new Sound();
DayNature.attachSound("Day_Nature01");
DayNature.setVolume(100);
DayNature.start(0, 10000);
DayCity = new Sound();
DayCity.attachSound("Day_City01");
DayCity.setVolume(20);
DayCity.start(0, 10000);
The problem is:
The last command DayCity.setVolume(20) set ALL sounds global to volume 20 ... Also the sound DayNature
Is there any solution for this Problem?
Regards
Cabo
Loading Multiple Sounds Problem
ok i want to load some music (more than one) into one single movieclip used to play the songs, but what is happening is that it only recognises the last song "music10"
here is my code
soundmx = new Sound(mxsound)
musics = new Array()
location = new Array()
for(p=0;p<11;p++){
musics[p] = "music"+p
}
function load_sounds(){
for(i=0;i<11;i++){
location[i] = musics[i]
soundmx.loadSound(location[i]+".mp3",false)
}
}
load_sounds()
function smx(mx){
loader = location[mx]
soundmx.attachSound(loader)
soundmx.start(0,999999999)
}
I have no idea why this wont work. Aaaargh, i really need some help.
I think its got something to do with the line:
soundmx.attachSound(loader)
but why ... Everthing whould work right. Is it because the loadSound
thing can't put more than one sound into a new Sound object.
Help
Multiple Sounds Fading-in And Out At Different Moments
Hello people.
Ok, my problem:
I have an animation where I use 5 different MP3 files, small cuts, which are "called" at different moments along the presentation.
Now, calling the cuts is more or less the easy part, the scientific part is the ending, or better, the fading-out of the cuts at a specific moment, at a specific speed (duration), no matter at which speed the animation is, that way all the cuts will fade-in and fade-out correctly in any computer.
I want to load (fade-in) each cut whenever I want, and also fade it out whenever I want.
Any advise you can give me?
Thank you very much.
Playing Multiple Sounds At The Same Time
Hi,
I have a movie that has a tune playing in the background on startup, which loops continuously. What I need to do, is have a stop and play button, which plays and stops a different sound over the one that is currently playing without effecting it.
My problem is that my stop button stops everything ( and im not using stopAllSounds(); ), im using a sound object and saying ( engine_sound.stop()
any help much appreciated
thanks
Help With Volume Controls For Multiple Sounds
Hey all,
I'm somewhat of a newbie at Flash and I'm in dire need of help with volume controls. Basically, I'm making a flash presentation for a company, and within the presentation there is background music(which is a mp3) and Voiceovers(which are wavs).
The issue is I need to make it so the music & the voiceovers volumes can be adjusted seperatly. Currently, the way I have it is that the background music will play, but when it hits the voiceover frame, the volume adjusts(overall) to what ever that voiceover is set to. So the whole thing only plays at one setVolume. I need to lower the volume of the music and raise the voiceovers.
Here is what I have, I have a sounds layer as my root.
Code:
firstSound = new Sound(BGMusic_mc);
firstSound.attachSound("bgm");
secondSound = new Sound(VO1_mc);
secondSound.attachSound("G1");
This is in frame1.
In frame 2 where the background music starts I have:
_root.firstSound.setVolume(25);
_root.firstSound.start(0, 0);
And then later in frame 163 where the first voice over is I have:
_root.secondSound.setVolume(50);
_root.secondSound.start(0, 0);
I've read quite a few tutorials, but I can't seem to be able to figure this out. Any help would be most appreciated.
[F8] Playing Multiple Sounds - Please Help Quick
Hey everybody,
I've got a flash movie i need to finish by tonight, so any help would be appreciated.
I'm trying to make two sounds, one is a looping background, one only plays once. My code is:
Code:
//looping sound
A = new Sound();
A.attachSound("loop");
A.start(0,99);
A.setVolume(30);
on first frame, and on the second:
Code:
//non-looping
B = new Sound();
B.attachSound("once");
B.start(0,99);
B.setVolume(90);
My problem is that when I set B's volume to 90, A's increases too. How do I fix? Please and thank-you.
Syncronize Sounds In Multiple Movieclips
Hello
I have made an "animated band" with 3 individual movieclips on the stage (drum, bass and guitar).
When you click on the drum, it starts hopping up and down and plays a sound-loop (4 seconds) until you click on it again, and then it stops. You start/stop the other movieclips the same way. It´s really fun
Now I would like some help to syncronize the movieclips - a script that counts to four (seconds) and starts the sound in the individual clip at the first second of the loop (waiting for the same rythm as the other guys...)
It is my first question i any forum ever, and I would be really happy if anybody wants to give me a hint to this script.
[F8] Controlling Multiple Sounds With 1 Button
I am trying to use the following code to switch between two different songs when a button is pressed.
Code:
mysound = new Sound();
mysound.attachSound("Blue Wrath");
mysound.start(0,99);
var song = "blue";
on(release)
{
if(song == "blue")
{
mysound.stop();
mysound.attachSound("Queen");
mysound.start(0,99);
song = "Queen";
}
else if(song == "Queen")
{
mysound.stop();
mysound.attachSound("blue");
mysound.start(0,99);
song = "blue";
}
}
However I get the following errors
**Error** Scene=First Scene, layer=Juke Box, frame=1:Line 1: Statement must appear within on handler
mysound = new Sound();
**Error** Scene=First Scene, layer=Juke Box, frame=1:Line 2: Statement must appear within on handler
mysound.attachSound("Blue Wrath");
**Error** Scene=First Scene, layer=Juke Box, frame=1:Line 3: Statement must appear within on handler
mysound.start(0,99);
**Error** Scene=First Scene, layer=Juke Box, frame=1:Line 4: Statement must appear within on handler
var song = "blue";
Total ActionScript Errors: 4 Reported Errors: 4
Can anyone help?
Stop Sounds In Multiple Movies?
I have a page with multiple movies that load sound.
The sound loads and stops fine with one movie.
When two are pressed the sound overlaps.
Is there a way to stop the first sound when the second begins?
Each movie is an individual file on the page.
Linkage Of Multiple Sounds In Loaded Swf
Yo all - help would be great.
Within a loaded swf I have sounds that are loaded in through linkage. To get them to play i have to use "(this)"
eg.
Code:
workSound=new Sound(this);
My problem is i cant use "(this)" for different sounds.
How do i get around this?
Load Multiple Sounds Online
Hello people!
I've been reading this wonderful forum for a while, but the time has come to jump in!
Well, I'm making a game and I have some problems with loadsound...When i test it on my computer, it runs ok and sounds are ok, and when i push a button with the instruction mysound.start(), the sound plays ok. BUT, when i put the game online, no sound is played! I also uploaded all of my .mp3's, of course. Directories are structured as follows:
-Data (is a folder containing the .swf)
-Sounds (a folder containing subfolders with sounds in .mp3 format)
And what is even more strange: i've put an onLoad event for the sounds when i load them (they are dinamically loaded at runtime, they are NOT in library), looking if a sound is loaded ok or not...well, testing it online, i can see that a message appears saying that it has loaded sounds ok!!! So, why aren't they playing???
Thanks very much in advance for your time!
Independant Toggle Of Multiple Sounds?
Hi there,
I was wandering if you could help me with a problem i have got. I have tried many tutorials and a few forums but i just cant get it.
I can stop and start a music sample by pressing a keyboard key. once to start, then a second time to stop.
However, when i i try to do this with more than one keyboard key it messses up. I can get All of the seperate music samples assigned to personalised keys playing simoultaniously but when i push one of the keys to stop one of the sounds, all of the samples stop.
I want to be able to control each music sample seperatley from specific keys.
Below is the code i am currently using. (is it right??). any help would be much appreciated please.
loop = new Sound();
loop.attachSound("drums");
var keyToListenFor:Number = 32; // space bar
var keyListener:Object = new Object();
keyListener.onKeyDown = function():Void
{
trace( "Key = " + Key.getCode() );
if( Key.getCode() == keyToListenFor )
{
if( isPlaying == true )
{
loop.stop();
isPlaying = false;
}
else
{
loop.start();
isPlaying = true;
}
}
};
Key.addListener( keyListener );
THANKS
john
|