ActionScript 3.0 :: Add Sounds To A Button?
Feb 9, 2009I would like to add sounds to a button, so when I roll over it, it plays the sounds. The thing is I would like the sound to be programmed in AS3, not imported like normal.
View 1 RepliesI would like to add sounds to a button, so when I roll over it, it plays the sounds. The thing is I would like the sound to be programmed in AS3, not imported like normal.
View 1 RepliesI followed the mp3player tutorial (part 3) from [URL] and got it working fine. Only problem is that the setVolume I'm trying to use with my music is affecting all my other sounds - button sounds and background sound. I'm aware of the createEmptyMovieClip/attachSound approach and got it working on my other sounds. But Lee's tutorial-mp3player is using a slight different technique, and so my normal approach doesn't quite work.
[Code]....
I am making a website, and have 5 loops that I would like to use.I need a button that will change between those 5 loops.I also need a button that will mute and unmute all sounds.
View 1 RepliesI want to synchronize sounds perfectly to do a kind of Audio Mixer, using different sounds. [URL] does it perfectly, I've been researching and researching and I just don't know how to do it! How does [URL] synchonize audio so perfectly? you can even change sounds and the new ones will come on time! How do I do that? Is it just Action Script? or something else?
View 1 Repliesim currently trying to make a game for a college project, im using flash professional 8,
the game rquires a random sound to be played on a button click, but i have no idea how to do that? all my sounds have instant and libary names of sound_1, sound_2 ect and i currently have this actionscript in place on the button, the button is called play_sounds.
play_sounds.on(mouseDown) = function(){
var randNum = Math.ceil(Math.random() * 10);
var mySound = new Sound();
[code]....
Im making a soundboard and I chose AS3 by accident.What I need the code to do is STOP the CURRENT sound from playing if another is pressed. the code that worked for AS1 and AS2 was onMouseDown [code] plays the sound once and messes the sound up after playing for only half a second or not at all.
View 5 RepliesI did a search here and I am not sure my question was answered exactly, and even if it was, I wouldn't know it. My problem is going above and beyond what the project calls for. So here we go:I have an external swf that I have loading in when you press a "play" button. Now I need to have a button that stops the sound ONLY on the externally loading swf. I assume from what I have Googled to death that this is called "stopping all sounds". I have also come upon a sound mixer dealy-o, but I'm not sure that is what I am trying to do?????I keep reading about SoundMixer.stopAll (); but this looks to mute the sound all together with no use of a button. So I am ASSUMING that there is more code to add to this when it comes to using a button.
So, I would like to know the EXACT code I need to use to get it working...if at all possible. I named my sound button "btn3_btn" and my mute button "btn4_btn" for now. I want a separate button to turn the sound back on once it has been muted.
I've produced an instructional animation for a client who now wants to add a mute button. There are several sound clips throughout the movie. How do I achieve this?
View 4 RepliesI want to play my songs in my Flash site..
I tried Making the song title as a button, and then I figured out how to make the song play by releasing the mouse button. This works great, however, when I click on the button numerous times, the song starts playing numerous times..
What I would like is to be able to click on my Song_btn once to start the song, and then click again on the Song.btn to stop the song.
or another option is to start the song with the Song_btn, and then some way to just let that song play through.
I have used the "stop all sounds" command when you navigate away from that songs particular page..
im using actionscript 3 with a button to play a sound, the only thing is I dont want to play the sound from a URL i want to play it from a sound imported into the library, im sure its simple I just dont know how.
[Code]...
I made 2 sounds: background and button sound.This is the code:
_root.onLoad = function() {
backgroundSound = new Sound(this);
backgroundSound.attachSound("sound_root");
[code]....
I'm trying to put together a simple flash file for a project I'm wokring on and can't seem to work out the actionscript to do what i want! Wondered if someone would be able to help me here? It's very simple what i want to do... I have 3 short sounds and one button. On pressing the button i want the sound1 to play, then as soon as it's finished start looping sound2 untill the button is released when sound3 would play. I hope this makes sense. (im using flash CS5 but set for actionscript 2/flash8, if it's easier in actionsscript 3 and flashCS5 let me know and ill change my approach)
View 1 RepliesCould someone direct me to a post (or explain) how I might be able to Toggle On/Off the muting of every sound playing in my .Swf?
I have several streaming sounds I don't want to (stop), just (mute).
What's I'm looking at doing is making a button that plays 1-20 different sounds at random each time the button is clicked (hit), and also have an image swap when that happens. A different sound and different image (the same 1 image per sound, not random images, just sounds "image1 goes with sound1").
View 1 RepliesWhen the movie loads, the music begins to play. I have a single Music On/Off button that can stop and restart the first track. However, whenever the user stops and then starts the music again, I'd like to alternate the track that plays.
As it stands now, only the the first track will play when the button is clicked (and when the movie loads, of course).
Code in action layer:
ActionScript Code:
var song = 1;
var my_sound:Sound = new Sound();
[Code].....
I have some sounds on buttons:
Code:
var mySound:Sound = new myLibrarySound();
myButton.addEventListener(MouseEvent.CLICK, playSound);
function playSound(e:Event):void
[code]....
... and that works fine. I then have some streaming music:
Code:
var myStream:Sound = new Sound();
myStream.load(new URLRequest("myPath.mp3"));
myStream.play(0);
... and that works fine too. Now, however, the initial button sounds have a slight delay -- I'd estimate about 150-250 ms. It's enough that rollover click noises happen about the time you click, and click noises happen about the time you release, etc. Now, here's the KICKER. It only happens in FIREFOX. CURSE FIREFOX. Seriously. I've been having so many Flash issues in FF3, it just drives me nuts. Firefox and wmode is a pain, Firefox and sound is a pain, Firefox has been crap for Flash development lately.
I have a film with 4 scenes in it: Here's a link to the film and as you can see the film does not play the music the second time because of the StopAllSounds function which is probably the wrong code to use. The first scene is just a button with 1 frame, a stop action and a music clip. The second scene is the film. The third scene is the credits fourth scene is a Play again button. I have a Stop all Sounds action on the fourth scene because if I do not use it and I press the Play Again button, the music from the first song keeps playing but also the music from the film starts up again so it starts to play twice. What I want to know is, how do I get the music to stop at the end of the film but start up again once I hit Play Again?
I am using Flash CS3 if that helps and using Actionscript2.
I have five different scenes all including three different buttons. When I test the buttons in "play scene" - all buttons sounds correctly in all scenes. But when I play movie, there is sound only with one button (the same button in every scene). I have looked for differences, but this button seem to have all the same parameters as the others.
View 10 Replieshow do u add sounds in your flash?im using macromedia flash pro 8
View 3 Repliesim using stopAllSounds();command to mute all sounds, and it works fine with sounds that are already loaded (background music), but if there is button which triggers some new sound (after activating mute button ) or any other function to import new sound object you still can hear it despite stopAllSounds();.which command to use to permanently block all sounds already loaded and those which can be triggered by future actions.Now i have stupid situation> background music is muted but you can still hear sounds when cliclking buttons (which is ok but NOT in muted stage).
View 5 Repliesanybody knows the AS to mute all sounds?
View 2 RepliesI am working on a game that involves a play head (called playHead) moving along the screen and when it encounters various movie clips it triggers a sound to be played. It is all going well except that the sound seems to want to play more than once, so there is a staggered wierd sound. Is is possible to make the sound only play once and also it needs to play until the the sound has finished. (the sounds are all very short).Here is the code:
onClipEvent(enterFrame){ if (this.hitTest(_root.playHead)){ _root.sound15.stop(); _root.sound15.attachSound("over"); _root.sound15.start(); } }
When I updated my Flash website I added new sounds to all buttons on the site. I also animated the main section buttons with a movie clip in the "over" frame. I added sound to the "down" frame of the animated buttons in the same manner that I added sound to the no n-animated buttons. When I click on one of the non-animated buttons and release, the complete sound plays.When I click on one of the animated buttons and release, the sound stops the instant I release the button. If I click on one of the animated buttons and do not release but continue to press the mouse button, the entire sound will play. How can I make the animated buttons behave like the non-animated buttons and play the entire sound even though the button is released?
View 26 RepliesI need a flv with two sound. I want to load load two different sound for one flv file. For example I want to load my flv file in frame 1 with sound 1 then I want to load my flv file in frame 2 with sound 2. How can I do it?
View 7 Repliesi load external swf to the main movie. They all have sound. Have no problem to stop sound of the main movie (by the behaviors), but it doesnt stop the sound of the external one. What AC should be used to stop all sound, external and internal?
View 1 RepliesIm preparing a Flash piece that includes several audio files. I imported the audio successfully but for some reason when I play the swf, the audio sounds tinny. I set the settings to speech compression and synced to stream. Some of the audio files were edited in Soundbooth to add silence at the beginning of the audio files. HOwever, all files (edited in Soundbooth or not) sound tinny.
View 2 RepliesTo stop all sounds in a swf, I'm using the following code.
var transform1:SoundTransform=new SoundTransform();transform1.volume=0;flash.media.SoundMixer.soundTransform=transform1;
This mutes all sounds. Now there is an issue, I want to stop all sounds but one (i.e. "music.mp3").
I want to synchronize sounds perfectly to do a kind of Audio Mixer, using different sounds. All I have been able to do is to play 2 sounds at the same time, but I cannot do it with 3 audios or more, they don't go synchronized. JamStudio.com does it perfectly, I've been researching and researching and I just don't know how to do it! How does JamStudio.com synchonize audio so perfectly? you can even change sounds and the new ones will come on time! How do I do that? Is it just Action Script? or are they using something else?
View 5 RepliesI participate in a important project right now and I have to implement a class that manages music and sound.The project that I'm making is developed in AS3 using the Flex enviroment.Is there a "best approach" or only different ones?
View 1 RepliesI posted a question earlier about stopping all sounds in a swf. Now, to do that I'm using the following code.
var transform1:SoundTransform=new SoundTransform();
transform1.volume=0;
flash.media.SoundMixer.soundTransform=transform1;
Which solves the problem (mutes all sounds) but now there is an issue, I want to stop all sounds but one.