Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[F8] Play More Than One Sound At Once



Hi there! It's my first post - woohoo... Anyway I am pretty new to flash, I started learning yesterday pretty much and have to make something interactive in flash for my uni module by Friday. I'm doing pretty well so far having followed a few online tutorials which have been very cool. So here's my problem...

http://img441.imageshack.us/my.php?i...edflashtg1.swf

the first 3 buttons have a whoosh sound when you roll over them. But it doesn't seem to play more than one whoosh sound at the same time. Each button is an mc and on their individual timelines they have sounds on a sounds layer which are placed under a labels layer for each mouse state (_up _over _out and _splat)

so how can I make it play more than one sound? And why does it say [F8] by my post?



FlashKit > Flash Help > Flash Newbies
Posted on: 01-16-2007, 08:46 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Making One Button Play One Sound And Another Play A Different Sound
i'm very much a novice when it comes to flash.
i've created three separate buttons in three separate layers. i've also added three music files in three more layers. how can i get it so one button plays one music file and another button plays a different music file? i've tried putting "goto and play" for each button in actionscript but it doesn't seem to help.

any ideas?

i would be very grateful

How To Play Sound Automatically And Trigger The Play And Pause On The Same Button?
hey guys,

is anyone know how to set a looping sound to play automatically but with a pause button to trigger its action? if i want the sound play back again could i just click on the same "pause" button to let it play again? pls help me to make it works thanks!!!

I Can Play Sounds From Xml. How Do I Only Play One Sound At A Time... Kill The Other
Code:
var mysound:Sound = new Sound();
mysound.loadSound(arVocab[_global.nCurrentWord-1][6], true);
This will play a sound but when I go to another question in my test the old sound still plays while the new sound starts.

How do I kill the old sound? When the new sound loads?

Glen Charles Rowell

Attach Sound, Play Sound & Stop Sound.
Hey there,

I was wondering if any of you could help me please.

I want to play a song which I have named "rundmc" The file extension is ".mp3"

I want a button to play this mp3 which I read you need to attach that sound, then play it and I want to a button to stop that sound, or preferably the play button to change into a stop button.

I've read the help files, but none of it works and I've changed the linkage for the mp3 to export for action script, but nothing works!!!

Please help,

NK.

How To Play A Sound For 6 Times With Set Play Interval?
Hi,

I know how to play a sound effect:


Quote:




var mySoundReq:URLRequest = new URLRequest("laser.mp3");
var mySound:Sound = new Sound();

mySound.load(mySoundReq);

mySound.addEventListener(Event.COMPLETE, playSong);

function playSong(event:Event):void {
mySound.play();
}




The above sound effect play only one time. Actually I wish to play the sound effect for 6 times and at a set play interval (e.g. play the sound effect, wait 2 seconds, play again, wait another 2 seconds......). How can I do that?

I am thinking to use a Timer object. However I have no idea how to link with the playSong function.

Thanks and best regards

Alex

On Press Play Sound On Release Stop Sound
I have a button that is inside a movie clip 'forward'.
When you press the button it plays another movie clip 'time' forwards

on (press) {
forward = "1";
}
on (release, rollOut, dragOut) {
forward = "0";
}

on the button and:

if (forward eq "1") {
tellTarget ("/time") {
nextFrame();
}
}

on the first frame of the 'forward' movie


I would like sound to happen when you press the button and stop when you realease the button

but I not sure how any help would be gratefully excepted

Sound Overlap When 2 Swf Play Sound At The Same Time P R O B L E M
Figure this:

I sen to my clients via mail an regular html with a swf embebed. They recibe the html and the flash starts playing the loop sound. Therere are, also the loop, severals sound trigered in different parts of the swf file.

the problem starts when my clients double click in the outlook inbox and the html pops up and there we have 2 html with 2 swf playing sound at the same time.

I tried stop all sounds at the begining of the movie. but it only stops the loop sound but not the trigered sounds of the rest of the time line.

is there a way to stop the sound of the first swf when the second pop up?

anyone?

[CS3] Make A Sound Play... (it's Different From My Other Sound Question :) )
How would you make a sound play when you press a button?
Thanks

Dont Play Sound Until Another Sound Finished
Hi guys

How do i wait until a sound has stopped playing before playing another sound. Ideally something along the lines of :

if (sound1.hasCompletedPlaying()) {
sound2.start();
}

im not sure what the boolean check is for if a sound is still playing or not though.

thanks in advance.

Play Sound/stop Sound Button
i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.
any help?
thank you very much.

PLAY Sound And STOP Sound
I have no clue how to play and stop sound. I tried everything but I guess I am doing it wrong!
basically...... the name of the clip i want to play is
sound1

i have a little play button and a little stop button
i need the code so that it will play sound1 when clicked on
and the stop button i just put stop all sounds so i guess that should take care of it..but if that is wrong then please let me know, lol
thanks

xox marqi

Play Sound#2 On Complete Of Sound#1?
I'm a total newbie when it comes to action scripting and I'm hoping someone can help me out.

I need a script that plays sound#1 and when sound#1 is over plays sound#2. Seems simple but I've been trying to figure it out without any luck.

The sound files are background music that play over a multi scene project so keyframing is not really an option.

Thanks
Andy Hunter

Sound Switch (on/off) To Play A Sound.
Hi there!

I am a begginer, and I would like to solve this:
There are 2 switches,(each one has "on" and "off" position)
But, only play the sound when the switch#1 is "on" and the switch#2 is also "on".For example if the Switch#1 is "off" and switch#2 is "on"
nothing happens, that is it!
Thanks!
Ricardo

Flash Intro - On Button Sound Play, Off Button Sound Off
Hello,

I am working on this flash project. I want to make it so that when you put your mouse on the button, it plays this song, but when you take your mouse off, it stops the song..sounds really easy, but I need some help. Thanks!

David

Not Getting Sound To Play
I have a sound file in my movie. When I click "play", I'm not hearing any sound (I know its not a hardware issue on my computer). Any suggestions on what might be the problem?
I tested the sound file before I imported it.
Thanks,

Why Does The Sound Play?
Hi,
In my flashmovie I use a sound in one place in one scen. Everything worked just fine.. and now suddenly the sound starts playing in other scens, seamingly random. WHY???
I haven't placed the sound in those sceans or in something I've used there...This puzzels and enoys me tremedously. would realy appreciate any thoughts..

Play Sound?
hi can somebody help me with play sound script??

cheers

Trying To Get Sound To Play
i'm using the attachSound command to start a sound on the click of a button. It works when i test the movie but when it is loaded into another movie the button doesn't trigger a thing?

This is the code on the button.


on (release) {
s = new Sound();
s.attachSound("amen");
_root.s.start(0,100);
_root.equal.gotoAndPlay ("on")
}

what am i doing wrong?

any help much appreciated..

Play Sound If... Else... ?
Hi,

I have created a quiz and want a particluar 'ding' sound to play if the user has the correct answer. If they have the incorrect answer I want a diferent sound to play. How can this be achieved using actionscript?

What do I need to add in order to get a different sound to play in the following script?

if (q1count == 25) {
question1 = "correct";
totalCorrect = totalCorrect+1;
} else {
question1 = "wrong";
totalWrong = totalWrong+1;
}

Any help is much appreciated. Thanks!

Glenn

Please Play Sound Only Once
i am writing a tutorial in flash, the questions r in text with acompanying sound, if the user gets something wrong they r presented with the question again, althogh i do not want to play the sound again . any clues appreciated.

Sound Play In An Exe
I have a exec made in flash (chapter1)which has some animation & sound playing in it. This file has an help button on click of which a help file opens but on doing so the sound in this file stops.

Now when i close the help file which is an exec and return back to the previous exe file (chapter1)the sound in the exe file should atomatically play.

Can anyone please help me on this asa possible as i am really stuckup on this matter.


thkz

Sound Keeps Going When I Play?
Why is it that when I go to Control>Play and test my animation and then when I try to stop it, the sound keeps going but my animation stops?

Sound Play
Hello,
I'm having trouble getting some music to play automatically when my sight loads and I can't figure it out.

The sound plays fine when I use the a regular button fuction like:

on (release) {
if (playing == undefined or playing == false) {
music = new Sound(this);
music.loadSound(tracks.firstChild.childNodes[nodeNum].attributes.path);
title = tracks.firstChild.childNodes[nodeNum].attributes.name;
music.start(0, 0);
}

}

When I tried to just strait apply it on the timeline, or on a MC using OnClipEvent(load) I got the same error that you see below.

Error opening URL "file:///D|/Projects%20Currrent/Misha%20Music/Dev/"

Does anyone know what control to use to make this work automatically, or any other suggestions.
Thanks, Jacob

Play Sound
Hi, im new to this so forgive me if this sounds like a stupid question. How can I get a sound to play if i press a key? Thanks very much.

Play Sound.
Hi folks,

How do i play a sound by using action script.

Thanks,

Ivorsmallun


Quote:




Don't knock it untill you've tried it...

Sound To Play Once Only ?
I have a 20sec mp3 that is placed in a key fm on the stage. This fm has a fm label
and is fm 25.
It plays fine. But of course every time the playhead returns to the fm the sound starts again and doubles and trebles etc over itself.
I would like it to play just the once and to loop.
Is there perhaps some form of 'if' statement that I could use so that
' if sound is playing do not play mysound.mp3'

I hope that that makes sense.
Thanks for any help
Trug

How To Play Sound?
i forgot how to import an mp3 file so it would play at sum tym in my flash movie..probably cuz i ddnt pay attention when the guy was explaining this at the course i went to hehe, i also want to kno if theres a way to cut the song and only use a part of it...

Can't Get Sound FX To Play Right
I am making my first game and I am starting to put sound effects in it for different events. I have it so that when you click the space key it sends the laser beam movie clip to frame 2 where the laser gun firing sound is in the time line. But if I press the sound several times within a few seconds the sound sometimes doesn't play.

I know that I can load the sound to a variable and then play it on a key press but I can't use any external files because that would use a lot of bandwidth on my server after the game is on a bunch of sites.

Is there a better way of doing this?

You Won...play Sound
I have a short little flash game. Music plays while the player looks for hidden objects.

When they find all of the hidden objects a movie clip loads to say "you win" and an applause.mp3 plays.

If they dont find all the objects in time at the end of the times line "out of time you lose" shows.

**My problem is, when the person doesnt find all the objects and it reaches the end of the timeline the "applause.mp3" still plays. I have the "winner" movieclip set to be invisible until all the objects are found but dont know how to keep the sound off.

here is the code I have:

// here I set the variables to mark if they are found
var object1Found = false;
var object2Found = false;
var object3Found = false;
var object4Found = false;
var object5Found = false;
var object6Found = false;

// here I put a function so I dont have to repeat the code for each
function displayIfWinner()
{
if (broccoliFound && meatFound && eggFound && mushFound && carrotFound && spinachFound) {
_root.gotoAndPlay(465);
}

//right before the Winner movieclip on the timeline I have this action

winner._visible = false

**This is where my problem is. The Winner movieclip in invisible but the "applause.mp3" is still playing

Play Sound
hi
can anybody say that how can we play a sound using actionscript
because my movie contain nearly 4 frame and it is looping a ball bounces everytime at that it play a sound also
can anybody can the actionscript for it

Play Sound Only Once
Hi!

I have a button (a_btn) who calls a movieclip (a_mc) that have a sound attached. The frame label of the movieclip is called "a_menu".

button code:
a_btn.onRollOver = function() {
a_mc.gotoAndPlay("a_menu");
}

movieclip code:
frame 1: stop(); -- this frame is empty
frame 20: stop(); -- frame 2 to 20 are identical

When the user moves the mouse over the button, the movieclip appears, plays the sound and stops with the image on frame 20. When the user moves the mouse over the button again, the same is repeated.

How can I make it end on frame 20 and stay there not playing the sound again?

Thank You
Ferran

Play Sound In Asp.net
I'd like to play music im my asp.net aplication using flash player. The problem is that i'd like to play music continued when i refresh my pages or when I passover to another page wich use the same flash player. Is that posible?

Play SOUND And The Go To URL
Hi All,

I want the visitor to click on a button. First a sound is heard and then they are taken to a url.

I'm using this script:

on (release) {
var your_sound:Sound = new Sound();
your_sound.attachSound("store");
your_sound.onSoundComplete = function() {
var intervalID;
intervalID = setInterval( function(){ getURL("

Play Sound In SC3
I have this code

var audio:Sound=new Sound();
audio.load(new URLRequest("my web site"));
var channel:SoundChannel=new SoundChannel();
mcPlay.buttonMode=true;
mcPlay.addEventListener(MouseEvent.MOUSE_UP,function():void{
channel=audio.play();
}
);
mcStop.buttonMode=true;
mcStop.addEventListener(MouseEvent.MOUSE_UP,function():void{
channel.stop();
}
);

It doesnt work me...what can be the problems?
show me problem num 1119

Sound Won't Play?
I am redoing quite a few buttons into mc's to be able to get rid of the cursor changing into a handcursor. The buttons all have a sound on them onRollover. When I put the script on the mc's instead, the sound doesn't play.
Here 's the code on the mc (on a separate layer)that holds all the buttons:

ActionScript Code:
this.createEmptyMovieClip("butempty", 1);myButmusic = new Sound("butempty");

and the code on the button/mc:

ActionScript Code:
onClipEvent (load) {    this.useHandCursor=false;}on (rollOver) {    setProperty(this, _alpha, 0);    myButmusic.attachSound("but2");    myButmusic.setVolume(50);    myButmusic.start(0.1);}on (rollOut) {    setProperty(this, _alpha, 100);}

I have changed the code to refer to "myButmusic" to abslolute (_root.themenu.myButmusic.etc) I have tried the above code, I have tried parent, but nothing changes. the usehandcursor thing and the set Property work without problems.
What am I doing wrong?

Getting Id From Url To Play A Sound
I've got 3 pages and three sound files. Can i create just one flash file to load in all 3 pages and then to get an ID from the url to play a specific file?

EX: Page1.html, page2.html and page3.html should play sound1.mp3, sound2.mp3 and sound3.mp3 respectively.

Instead of creating a flash movie for each page, i just have one movie that is loaded on all pages and plays the corresponding sound.

I currently use this for the "play" button in the flash movie (doesn't work)

Code:
on (press) {

if(_root.id==1){

this.loadSound("../media/mp3/sound1.mp3")

}else{

this.loadSound("../media/mp3/sound2.mp3")

}else{

this.loadSound("../media/mp3/sound3.mp3")
}
}
this is how i have the embed code in my html

Code:
<object type="application/x-shockwave-flash" data="../swf/commonplayer_1.swf?id=1" width="149" height="100" wmode="transparent" ><param name="movie" value="/swf/commonplayer_1.swf" /><p>You do not have the flash plug-in installed. If you would like to view this site you will need to go <a href="" title="">download the flash plug-in</a>.</p></object>
Please tell me what i am doing wrong and correct it!

Sound Won't Play?
I am redoing quite a few buttons into mc's to be able to get rid of the cursor changing into a handcursor. The buttons all have a sound on them onRollover. When I put the script on the mc's instead, the sound doesn't play.
Here 's the code on the mc (on a separate layer)that holds all the buttons:

ActionScript Code:
this.createEmptyMovieClip("butempty", 1);myButmusic = new Sound("butempty");

and the code on the button/mc:

ActionScript Code:
onClipEvent (load) {    this.useHandCursor=false;}on (rollOver) {    setProperty(this, _alpha, 0);    myButmusic.attachSound("but2");    myButmusic.setVolume(50);    myButmusic.start(0.1);}on (rollOut) {    setProperty(this, _alpha, 100);}

I have changed the code to refer to "myButmusic" to abslolute (_root.themenu.myButmusic.etc) I have tried the above code, I have tried parent, but nothing changes. the usehandcursor thing and the set Property work without problems.
What am I doing wrong?

Why Won't This Sound Play?
I have this mp3 plays, but i cannot get it to play with flash.

I have a simple 1 frame swf with this code:

CODE//load audio, stream then loop
var my_sound:Sound = new Sound();
my_sound.loadSound("http://smartlegacy.com/ohsnap.mp3", true);
my_sound.onSoundComplete = function() {
my_sound.start(0,1);
}

Sound Won't Play
Hi there
I thought this would be relatively easy but yet again I've run into problems.

I've got a main movie into which another movie is loaded. I've got sound on the second movie but it refuses to play. If I play the second movie on its own its fine. So I know its a depth issue.

I've tried both of the following but neither will work:

Code:

var trackSound:Sound = new Sound();
trackSound.attachSound("track01");
trackSound.start();

Code:

var trackSound:Sound = new Sound();
_root.trackSound.attachSound("track01");
_root.trackSound.start();

Any ideas pleaseeeee

Sound In Keyframe:does Not Play During Whole Swf
I've created a swf with guide layers. I try to put a sound in a keyframe (meaning to hear sound during the whole swf)
The sound is playing during the action in the guide layers and stops when this end.

Although the swf is not finished.

I've tries to put the sound layer on thop of the timeline, on the bottom, below the guided layer, nothing helps

What is the clou???
__________________
sSaTbIrJiNna

Pause/play Sound?
how can i do this?

How I Can Play An External Sound
I want know how I can play an external sound file in flash format without stop them when I load another flash movie. Thank you

Play Sound And Only 1 Loop ?
Hi!

I´m using the attachSound method in my movie. I have a play button and a stop button. When you click on the play button a sound begins to play. And the stop button stops it. After this,if you click on play button again, the sound begins. Here´s all right. I use the following code to avoid the sound plays more than once at same time if you click on play button while it´s playing:

Code for play button:

on (press) {
if (!playing) {
sound1.start(0, 1);
playing = true;
}

How Can I Play A Sound From Outside Flash?
I want to do a button that plays a sound that is located in the same directory as the flash movie.

How can I do that?

Thanks

Play A Sound After Another Ends
I was thinking ( no, really I was! ):

I want to play a song of mine in the background of my site, but a fade-in wouldn't do justice to what I have in mind.

Instead, is there a way to play an intro wav, then when it ends, start the loop of my song?

Or even better yet, be able to loop a wav X amount of times, then move onto another wav that loops Y amount of times, etc.

That way, any part of a song that loops would only have to load 1 loops, and re-play it. An entire song could be reduced to just kilobytes and still maintain a decent sound quality.

Thanks in advance!

-The Surgeon General
http://www.lux.ms

On Monuse Over Play Sound...?
Hi All,

what is the script for playing a sound on mouse over..???

cheers

Play Sound When The Mouse Is Down
Hi,
i'd like that in every place of the stage , pushing the button of the mouse i can play a sound.....
how i can do???'
bye!

Variable To Play Sound
Post Preview:
On the mainstage my intro animation takes place in one frame. all the objects go onto the screen via actionscript. Im am trying to sync a small sound
when several movieclips reach their final destination
point. Is it possible to play a sound or play a clip/w/sound using a variable, for instance,
movieclipApos = _root.movieClipA._x
if (movieclipApos = 100){
_root.soundclip.gotoAndPlay("sound start");
}

or something of that nature.

thanx for your help.

Copyright © 2005-08 www.BigResource.com, All rights reserved