ActionScript 3.0 :: Flash Playing Multiple Sounds At Once?
Jan 16, 2012
i seem to be posting a lot at the moment but i am trying to get my Flash Skills up to date, hope im not annoying anyone too much. Basically i have a small project where pressing a button will trigger a sound, So when i click 'Button1' it plays the sound assigned to 'Button1', I have done this like the following.
[Code]...
Eventually i am going to have 20 different sounds, i know i need to probably assign each sound to its own individual sound channel. i tried manipulating the for statement to say something like var [i]Channel = new SoundChannel; in the hope that it would assign a number next to the SoundChannel thus making it unique,
View 5 Replies
Similar Posts:
Sep 3, 2010
Working on a project with multiple sounds (all contained in different MCs) played by different key board events. Most of it works, but when I try to use simultaneous 2 button combinations to call upon a different sound, all 3 sounds play at once. The 3 sounds are as follows: the sound associated with the first button, the sound associated with the second button, and the sound associated with the 2 button combo. I've made several different true/false statements to override different events and states, but they don't affect the playing of the MCs. I've also tried using attachSound but I don't like the results I'm getting from that either.
How can I stop the first 2 sounds from being played, so only the 3rd sound can be heard?
View 2 Replies
Sep 6, 2010
Inspired by Andre michelle, I`m building a tone matrix in AS3.I managed to create the matrix and generate the different sounds. They don´t sound that good, but I´m getting there One big problem I have is when more than one dot is set to play, it sounds just horrible. I googled a lot and found the additive synthesis method but don´t have a clue how to apply it to as3.anybody out there knows how to play multiple sounds together? any hint?
View 2 Replies
Sep 7, 2010
Inspired by Andre michelle, I`m building a tone matrix in AS3. I managed to create the matrix and generate the different sounds. They don�t sound that good, but I�m getting there One big problem I have is when more than one dot is set to play, it sounds just horrible. I googled a lot and found the additive synthesis method but don�t have a clue how to apply it to as3.
View 2 Replies
Apr 10, 2011
I am creating a game that has 6 movieclips all on the main time line of the game. Each movie clip has three buttons that when clicked plays, pauses or stops a sound clip.When I press any of the sound clip play buttons that sound starts playing, the problem is when I click any of the other sound clip play buttons those sounds also start to play. Is there a way I can disable the other sound clip buttons while the current sound is playing then enable all of the buttons when the current sound has stopped.
This is the code that creates one of the sound objects
[Code]...
View 3 Replies
May 4, 2010
I'm working on a game in Flash, and everything's going along great, until I start trying to play sound effects. The minute I start trying to play a sound, the whole app seems to "hiccup", frames get dropped, and things generally get ugly for a little bit. I'm loading sounds by copying them into my Flash CS3 library, exporting them for ActionScript with a Base Class of flash.media.Sound. I'm playing them through a class that looks a little something like this...
Code:
public class SoundPlayer {
private var _mySound:Sound;
public function SoundPlayer() {
_mySound = new ExampleGame.SoundFromLibrary();
} public function playSound() {
_mySound.play();
}}
This all seems pretty straightforward, so I can't figure out why Flash is complaining when it first tries to play the sound. The sound itself is a 40k. mp3 file that lasts about 2 seconds. Not the shortest sound in the world, but I'm sure I've heard larger sounds in games.
View 3 Replies
May 5, 2011
I am looking anywhere to find a way to play sounds in reverse wih flash.
View 5 Replies
Mar 2, 2010
Okay, so I'm using
Code:
exampleSound = new Sound(this);
exampleSound.attachSound("exampleLinkageName");
[code].......
View 5 Replies
Aug 18, 2010
I have two buttons on a single frame that each play seperate sounds when clicked though actionscript is throwing up this error and I have no idea how to fix it.
1151: A conflict exists with definition snd in namespace internal.
1021: Duplicate function definition.
Warning: 3596: Duplicate variable definition.
[Code].....
View 2 Replies
Mar 10, 2009
Here's the setup:
-I have a music score that will be streamed in via actionscript
-I also have multiple short sounds (SFX) in multiple nested MCs
-these SFX sounds are customized using the ide edit interface, so it would be a pain to use actionscript to play each sound
What I need: To have 1 mute button for the music, and 1 mute button for the SFX, both on the root timeline.[code]...
View 7 Replies
Nov 24, 2009
I would like to make a small player where two sounds* can be compared.
- PLAY and CHANGE buttons
- On pressing PLAY button, two sounds (Sound-A and Sound-B for example) should play simultaneously (at the same time).
- While those two sounds play, Sound-B should be MUTED and Sound-A should be hear.
- On pressing CHANGE button, the situation changes: Sound-A is muted and Sound-B can be hear. And vice-versa.
*two sounds: both songs are the same, but one of them is remastered
View 2 Replies
Sep 10, 2010
The free version over at [URL] displays sound in their online demo, but when I download the Fla. and preview it out of CS4 everything works but there are no sounds playing when I flip. SoundOn - true has been set, and I cant work out why it isn't working. No settings have been changed apart from soundon. I have tried with their older version 2.14 and that works fine.
View 4 Replies
Jan 16, 2009
There are 8 letters in the menu. Each letter provides a linkwhen clicked and a sound when rolled over. The letters will NOTAPPEAR on stage until their corresponding sound is completedloaded. I did this to avoid distortion during playback. The soundbit are pretty small as well. Anyway, the sounds are still distorted during playback and Idon't know why. They are all MP3. HELP PLEASE!! Here's the scriptfor one of the eight letters (movieclips) only to limit size you'llhave to look through:
public function Index() {
var D:MovieClip = new dMC();
D.x = 100;
[code]........
View 4 Replies
Aug 26, 2009
Does anyone have any clue on how to unload an external swf with all its sounds?
View 1 Replies
May 16, 2010
I've got 2 different movieclips, one named playScreen and one named gameOverScreen. I've got a function in playScreen that plays a gunshot everytime I press the left mouse button, but when I do removeChild on playScreen and addChild on gameOverScreen, the gunshot sound still plays when I press the left mouse button.
View 3 Replies
Mar 13, 2010
I have an animated flash site with lots of small mp3s placed directly on frames to match the animations.URL...Placing sounds on the frames added to the overall file size but was fine till I tried to create a sound off/on button - it seems that to manipulate ALL sounds they need to be placed into a movieclip.After followind a Kenny Bellows sound tutorial I placed all the little mp3's in an external file externalSoundObjects.swf.[code]I can place the mp3's back on the animation's timeline if anyone knows how I can get a sound on/off button to stop ALL sounds (incl. in child.swf's).Otherwise if anyone knows how to get the external sounds working I think I can then create a sound on/off myself
View 7 Replies
Oct 26, 2011
I put my music player to one domain and music files to the other one (i.e.:[URL]. As the player's setup is via xml file I just set there to look for that .mp3s with given url. I thought I need to put some crossdomain.xml to the domain with mp3s but meanwhile my music player doesn't need it and loads all the music from other server and plays.. So, do I need some policy file or so as I thought, or maybe my thoughts are outdated?
View 9 Replies
Jun 10, 2011
I have three embedded video clips that are inside of movieClips. They I have buttons that take you to a framelabel where those movieClips are located. Each movieClip containing each movie are on separate frames. (See attached image)
When I click on any of the buttons that take me to any videoClips other than the first one, make the audio from the previous embedded Video on the timeline in front of the one I went to , start to play.
I have SoundMixer.stopAll();
on everybutton before I tell it to go anywhere. what to do to only get audio from the video clip in that section of the timeline to play.
View 0 Replies
Jan 20, 2005
I'm trying to make buttons for my website that have sounds playing on them during the over states. But when you move the mouse off the button, the sound keeps playing. Run that mouse everywhere, the sounds are all playing, it's chaos. How do I fix a button so that the sound stops playing when the mouse moves off?
View 4 Replies
Aug 10, 2006
I have 10 to 15 different exe files which I want to play one after another, is there any way to play them. Do I have to make the batch file and play the exe file.
View 5 Replies
Jan 19, 2003
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);
[Code].....
View 4 Replies
Aug 5, 2010
I am making a slide show, for every image i want sound on it. For example if it the "Tiger" in the image, it says "Tiger". I have all the voice in .wav format.
Right now my slide show is xml based and in as3, i have made another attribute for voice.
Let me know how i can play different sounds for different images.
View 5 Replies
Nov 11, 2005
im am using this script in my current movie to attach sound using acttion script it also has a stop/start button but i need to now how to add multiple sounds in this way.
[Code]...
View 2 Replies
Jun 11, 2009
In my app, scenes on the stage play based on user interaction, and are accompanied by sound clips that are loaded through a soundLoader class (see below). I can play the correct track from the model, but I can't figure out how to correctly write a loadTracks function that will proload all of the track options for a given scene, and then play the correct one based on what the user clicks without a pause. How would I preload and store those sounds in a way that I can use them when needed?
Code:
package mvc
{
import flash.display.*;
import flash.media.*;
import flash.events.*;
[code]....
View 2 Replies
Apr 27, 2009
m using Flash 8. And I'm trying to adjust two sounds files using action script. First I set a sound file to 100, then I tried to set another file to 25 but when that happens, it also sets the first sound file to 25.
How do I adjust the second sound file so that the first one doesn't get changed as well.
By the way, here's the action script I was using for both sound files:
Sound File 1
background = new Sound();
background.attachSound("Kingdom Hearts Theme");
background.setVolume(100);
[Code].....
View 2 Replies
May 14, 2009
I have 10 sound files in an array.I am wanting to preload all of them and update a counter once each one loads sucessfully.So when song 2 for instance finishes loading then the counter would be at 2,then 3,etc....I think maybe I need to use a while loop to hook each sound into a load event?
View 1 Replies
Nov 17, 2011
Are there any audio management libraries for ActionScript 3? The more tailored they are for game development the better.I'm finding it hard to understand and work with multiple channels, which is making a lot of my audio sound screwy and cancel each other out, etc. I've been working on an RPG that can at a given time have quite a number of sounds playing such as environmental noise (like opening doors, thunder, rain, etc), walking enemies, inventory sounds (for events like dropping an item into your inventory), passive spell-casting sounds, voice clips, weapon swinging etc. Alternatively, if there are any good resources that explain how to use multiple sound channels strategically.
View 1 Replies
Apr 10, 2003
I need a little advice. I've got a set of swfs that are all part of one training, and within these movies are a few sound effects attached to button instances. I want the user to be able to click a button to turn the sound on or off at any time during the training.
My first idea was to create a variable called wantSound, which each sound instance checks before deciding to play. This is working perfectly. There's a toggle switch on the main timeline that sets sound to on or off, and when a sound is supposed to play, it checks to see if wantSound=true, and plays, or if it is false, it does not.
This works fine on each individual .swf, but when a new .swf loads in, the sound defaults back to true, and the user has to turn it off again. I imagine this could be fixed by loading each movie into different levels instead of loading them into level0 or root, but as this is not how I originally created the file, that will take a lot of work to handle aligning the loaded movies and parking them (making sure none of the buttons are active on the level below). I'm lazy, what can I say? :-)
I've been looking around at similar questions, and found a decent tutorial on Macromedia's site about using javascript to pass a variable from flash to HTML. I went through that, and managed to get Flash to send my wantSound variable to HTML with no problem. Check here for the tutorial.
The only problem is that in macromedia's example for sending data from HTML back to Flash, they use a text field for getting the variable. I just want to take the variable sent from Flash to HTML and send it back to Flash when requested (at the beginning of the next SWF.)
View 1 Replies
Dec 17, 2005
I have set this:
Code:
mp3_1 = new Sound();
mp3_1.loadSound("1.mp3", true);
mp3_2 = new Sound();
mp3_2.loadSound("2.mp3", true);
[Code]...
View 2 Replies
Jan 22, 2009
I have figured out how to play a sound with AS3, but i cannt figure out how to use multiple sounds. to play a single mp3, i am using this:
Code:
//number that is redefined when the pause button is hit
var pausePoint:Number = 0.00;
//a true or false value that is used to check whether the sound is currently playing
[Code]....
but what I need to do is have 4 different mp3's, each with its own stop & play button, so the user can play any file they want. These are voice over reels, not music, so each needs its own set of buttons.
View 1 Replies