How To Make An On/Off Sound Button That Works For Multiple Streaming Audio?
Hello Flashmeisters! I am having some trouble making a button that will resume the sound in my Flash Animation.I have an animation that is spread over several Layers and several Scenes. I also have sound clips (mp3s) placed on different layers, in many different areas. I was able to make a button that when pressed stops all the sound by using this simple actionscript:on (release) { stopAllSounds();}My goal is to have a button so users can stop and resume streaming sound at any time throught the animation.However I can't seem to make a button that after it stops the sound, when pressed again would resume the sound. I have seen some tutorials that explain how to stop and start a single audio file, but how can I make a button that will stop and resume multiple streaming audio files that are placed in several different places?I made the script below up and was wondering if there is an existing simple actionscript code that would be similar to it that would work for when a button is pressed it would resume the sound?on (release) { PlayAllSounds();}Many thanks! And any help will be HUGELY apprecaited!Marsy
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-28-2008, 04:03 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Streaming Audio Not Working In IE (works In Firefox)
EDIT: Problem solved. I upgraded to the latest version of the Flash player, and audio now works.
I'm currently working on a presentation, and use SWFObject to run it in a browser. You can see it here...
http://asureimage.com/presentations.php
The SWF streams an audio track (MP3). This works just fine inside the Flash development environment, and in Firefox. In IE I can view the presentation, but get no sound.
I can directly reference the audio track in IE, and it plays just fine in Quicktime. To further check this wasn't a general audio problem in IE, I ran a YouTube video, and that worked just fine.
Any ideas on what the problem is?
Edited: 05/05/2007 at 01:59:01 AM by megaresp
Multiple Audio Streaming
Hi. I 'm trying to create a radio station. It will include mp3 streaming, audio streaming from built-in microphones and live connections. All of them are ok, i made it before. But i did that with creating streams more than 1. For example the mp3 stream is playing on a NetStream object, and someone is talking with live connection on another NetStream object. These are working on user client side at the same time. So to use a lot of NetStream object is messing the bandwidth. Now what i want to do is, how can i publish a mp3 file and an audio stream on only 1 NetStream object. Is there a way to do this? If answer is no, how can i solve the bandwith problem or how can i publish multiple streams on just 1 publish point at the same time?
Thanks.
Edited: 09/10/2008 at 12:44:41 AM by mitamafia
Streaming Multiple Audio Files At Once
Hi,
I have a rare project/issue that I am working on. I have GOOGLED this issue and have not seen similiar problems or projects out.
I have to stream 4 sounds at once and make sure they are all in-sync. At any giving time a user can make 1 of those sounds play at a slower tempo. So far this is doable. The issue comes here. The user can also set the slower tempo audio back to normal. When they do this, that audio has to still sound in-sync with the rest of them. That is the trick...
There are 4 differnet sounds in total. I do not want to have 8 sounds (1 normal tempo and 1 slower tempo), because that will effect the preformance.
Does anyone have any ideas or solutions?
Thank you
PS: If ultrashock does not know, then I guess it can not be done.
Streaming Sound Works Only Locally
Hello
I'm trying to make a player to put on my website. Everything goes fine when i use it on my pc... But once the player is online ( the sound source is always online) i cant hear any sound
Here is my code
Code:
function stream(){
sound = new Sound ();
sound.loadSound("http://www.myadress.com:9090", true);
sound.start();
}
Thanks!
Make Streaming Audio Loop?
Below is the action script i have added to 4 buttons in a flash movie called "sound".
Each button loads a small sound clip. The AS works, no problems, but now I need to make the streaming sound loop... Thats when I have hit a stump in the road....
AS for each button:
ActionScript Code:
on (release) {
//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_karizma1',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.karizma1 = new Sound(this._parent.BS_karizma1);
} else {
this.createEmptyMovieClip('_karizma1_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.karizma1 = new Sound(this.BS_karizma1);
}
_global.Behaviors.Sound.karizma1.loadSound("http://www.dj-karizma.com/karizma1.mp3",true);
}
Really could use some brain power on this mid week crisis...lol
thanks as always!!!
ZG
Streaming Audio Loads, But No Sound
Hi all!
This is my first post here after reading these forums for a few weeks. I am having a problem with an audio player i made.
Basically, the file plays fine when i "test movie" in flash2004MX v7, but when i upload the swf and mp3, i can't hear any sound. Windows Task Manager Networking is indicating that the files are downloading fine! I've tried on a few different (very fast) servers, but i get the same problem. I have flash player 7 installed, by the way. Any help would be much appreciated, as i'm quickly approaching a deadline on this project!!
here is the basic gist of the code i'm using:
global_song = new Sound;
global_song.stop();
global_song.loadSound("track1.mp3",true);
global_song.start();
Streaming Audio / Sound (object) / Radio, Etc.
I'm trying to make a flash movie that's essentially like a radio that streams mp3s. Ideally, it would function like the one on http://www.superhere.net.
I'm trying to figure out how to use Sound objects to make a dynamically-loading playlist sort of deal, with the soundOnComplete method, but I can't get sound objects to work for me period.
I don't know what's wrong, but I'll try to come up with some questions. Where should I be writing out the ActionScript? In its own layer in the main movie, or should it be attached to a symbol?
I'm pretty much a novice, so please excuse me if I sound like a moron.
Thanks a lot for your time.
Creating A Sound Site That Has Streaming Audio
Hi. I'm not sure of where to post this question, but here goes:
I would like to create a website that allows users to upload mp3 files and then a flash file is generated from that on the fly and is available for other users to preview the file prior to downloading. Similar to what Flashkit offers in their Sound Loops section now. Is there a server package that allows this, or could someone point me in the right direction of a tutorial that may assist me in developing a site such as this? I would like to build the site is ASP or PHP. Thanks in advance for any advice
michelle
Sound Object Funkiness W/ A 2nd Streaming Audio File
Here's my issue... on frame 1 of my root timeline I have background music that is called from the library (works fine)by the following code:
code:
_root.bgMusic = new Sound();
_root.bgMusic.attachSound("winning_drive");
_root.bgMusic.start();
_root.bgMusic.onSoundComplete = function() {
_root.bgMusic.start();
};
I also have a narration that is on the actual timeline being streamed(works fine as well).
on frame 30 I have the following code to lower the volume of the background music ONLY, but it lowers both the narration and the background music... WHY!!!
code on frame 30:
code: _root.bgMusic.setVolume(40)
URGENT Seeking Template For Streaming Audio With Sound Controls
Hi there dudes!
oki hehe im in deep **** and have a serious time deadline to get done a flash presentation which would need a play button, pause, stop, fwd and rewind button..
In short i need to sync about 3 mins of speak with animation in flash, i use flash MX.
I have kind of a working template now but my problem is the rewind buttons..if i hold down the rewind button for too long in the speak and animation my flash gets stuck..the current file im working with you see has 3 scenes..and in scene 3 is where i have the controls buttons and speak..what almost happens is that when i hold down the rewind button for too long it goes to the previous scene and gets stuck..so this has to be somehow fixed..wondering if anyone has a working control buttons like this that arent buggy...
kindly email me asap...or if you have a link or template id be so greatful!!cheers!
c
Multiple Streaming Sound Manipulation
Hey there.
I have a site where as you click links, you move forwards through a city. I want to fade sound files in and out, overlapping, depending on where you are in the city. (The site is www.eskimojoe.net)
As yet, I can't have two sounds playing at once.
I have found a site with the effect I want, it's at
www.sofake.com
(Great site, by the way)
My code is as follows.
I have two sound loops at the moment, one of cicadas, one of a city at night, both saved as separate .swf files, which I have loaded onto the main timeline on layers 14 and 15.
The code for the two loops is:
cicadas.swf, FRAME 1
var volPercent = 20;
cicadas = new Sound(cicadas);
cicadas.setVolume(volPercent*2);
city.swf, FRAME 1
var volPercent = 20;
city = new Sound(cityMC);
city.setVolume(volPercent*2);
Once I load these two onto different levels, I get no sound.
If I delete one, the other will play.
I have tried loading the sound objects into empty movie clips, but then the entire file has to load before it will start playing. I need a way to stream multiple sound files, and have control over their volume. Is there a thread or tutorial out there that can solve my problem?
Sorry if this post is long and convoluted, it's hard to explain
cheers,
stu
Multiple Streaming Sound Manipulation
Hey there.
I have a site where as you click links, you move forwards through a city. I want to fade sound files in and out, overlapping, depending on where you are in the city. (The site is www.eskimojoe.net)
As yet, I can't have two sounds playing at once.
I have found a site with the effect I want, it's at
www.sofake.com
(Great site, by the way)
My code is as follows.
I have two sound loops at the moment, one of cicadas, one of a city at night, both saved as separate .swf files, which I have loaded onto the main timeline on layers 14 and 15.
The code for the two loops is:
cicadas.swf, FRAME 1
var volPercent = 20;
cicadas = new Sound(cicadas);
cicadas.setVolume(volPercent*2);
city.swf, FRAME 1
var volPercent = 20;
city = new Sound(cityMC);
city.setVolume(volPercent*2);
Once I load these two onto different levels, I get no sound.
If I delete one, the other will play.
I have tried loading the sound objects into empty movie clips, but then the entire file has to load before it will start playing. I need a way to stream multiple sound files, and have control over their volume. Is there a thread or tutorial out there that can solve my problem?
Sorry if this post is long and convoluted, it's hard to explain
cheers,
stu
Streaming Audio With Toggle On/Off Button
Hi, Im currently working at adding a streaming mp3 to my .swf. Im doing it with loadSound command. I have put the Sound Object just at the start of my movie, so it locates the file and streams it automatically. It works fine. Now I want to add only one button that toggles the sound ON or OFF. I have found a solution here:
Code:
on(release) {
if (_root.playing!=1) {
if (mySoundPosition==null) {
mySoundPosition=0;
}
_root.mySound.start(mySoundPosition,0);
_root.playing=1;
} else {
if (_root.playing==1) {
mySoundPosition=_root.mySound.position/1000;
_root.mySound.stop();
_root.playing=0;
}}
}
Unfortunately, it doesn't work well. In my movie, the button appears after the streaming audio starts to play, and when I hit it, first, the music restarts and when I hit it again, it stops (should be opposite). Additionally, when I hit it for the third time, I doesn't work at all.
I'm sure I have to switch something in that code, but Im not an expert, so I would be grateful if you coul help. Thanks!
Streaming Flash Audio From A Click Of A Button
I know how to convert mp3 and wav files to .swf files. My question is, how do I stream a .swf audio file from a click on a .jpg or .gif image. As of now I can import a flash file which streams as soon as the html file opens, but I need for this not to happen but instead stream when clicked only. Any thoughts for this flash newbie? Many thanks
Chris
Multiple Sound Channel Audio Playback
Hi all
I'm working on a project to create a simple music sequencer in AS3. The basic functionality is done.. however when it comes to playback the audio isn't always triggered on time and if there are many notes playing at once you get some clicks and blips.
Each note on the keyboard has a timeline on which notes can be placed and this timeline class has it's own SoundChannel assigned to it. When the 'play' button is clicked each noteline class is queried for its trigger points (when the notes start and stop) and this is compiled into an array which is used by a TimerEvent to determine when to play the notes.
Can anyone think of a more efficient way of doing this, that would possibly eliminate the lagginess and clicks? I noticed the SoundMixer class has a computeSpectrum() method which outputs a slice of the sound spectrum but I have no idea if that would be any use for this program.
Multiple Audio Files With One Sound Object?
So, theres the simple way to play an audio file:
mySound = new Sound();
mySound.attachSound("some_song.mp3");
mySound.start();
I'm trying to set up a play list. I've got a couple ideas on how to do this, but they're not straight forward. I would imagine there is something set up in Flash to do this easily, but I'm finding nothing.
Any ideas out there?
Thanks,
Steve
PS - The emoticon isn't expressing an emotion for me, I just find it pretty entertaining.
[audio] Loading Multiple Sound Files
Hi everyone,
Im having a problem loading in several audio clips using the sound() command. I searched through the boards and there was a lot of posts with no replies, or answers that werent really solutions. Im hoping for a bit of luck with this one.
Problem:
I have a base.swf file that loads an ambient bg track into my scene as well as a function to play voice over tracks when called.
Code:
//voice over audio
function audio(vo) {
myAudio.stop();
myAudio = new Sound();
myAudio.attachSound(vo);
myAudio.setVolume(20);
myAudio.start();
}
//bg audio
bg="BG_Music";
bgMusic = new Sound();
bgMusic.attachSound(bg);
bgMusic.setVolume(100);
bgMusic.start();
I have my timeline load different swf files at various times using the loadMovie() command.
Code:
loadMovie("video_01.swf", _root.video);
Each loaded swf file calls the audio() function and tells it what voiceover to play
Code:
_root.audio("voice_01");
This all works fine and dandy until the second swf file is called, then for some reason it cuts out the ambient bg track.
Any ideas? If you want to take a look at the project you can download it here:
http://vertx.ca/download/Flash/presentation.rar
Any help would be greatly appreciated.
Cheers
Mike
Mute/unmute Button For Streaming Audio Using Mp3s In 'media Display' Component
I am currently streaming an mp3 onto my site through the media display component which is invisible. This is great apart from I cannot seem to make a mute/unmute button to control it. I've tried the other streaming component(media playback) but I don't want anything that big or need all the control that it offers. Really I just want a mute/unmute button or possible a volume slider. I have tried this method...
(first frame)
my_mainsound = new Sound(this);
my_mainsound.setVolume(100);
(on a button)
on (release) {
if (SoundIsMute) {
my_mainSound.setVolume(100);
SoundIsMute = 0;
} else {
my_mainSound.setVolume(0);
SoundIsMute = 1;
}
}
....but I think this only works for sounds inside the swf as opposed to streaming sounds.
Any help ideas much appreciated.
m
Help Everytime I Make A Button It NEVER Works
I am new to flash, but I got some of the basics sort of figured out. Right now my biggest issues are everytime I make a button it NEVER works. When I use behaviors instead of trying to do it myself then the links from the buttons just open on their own without any clicking. Does anyone have any clues, suggestions?
My other issue is I converted text into a movie clip to make a motion tween. When I hit play and watch the timeline it works great, but when I test the movie the motion tween isn't there. The text just pops up instead of a gradual fade in. Again, any clues?
Please Tell Me If This Sound Button Works?
Can someone just check this sound toggle button for me and tell me if it's working? I'd check it out myself, but the sound on this darn computer doesn't work. I need a reply within thirty minutes, that's my deadline (!).
Streaming Sound And An On/off Button
I have an mp3 that I want to be streamed on my Flash site that I am designing. Firstly how do I stream the mp3 file so that it starts playing before its fully loaded.
Secondly how do I have a button that starts and stops the sound, what actions do I add to it? Is it possible to have the button change depending on whether the sound is playing or not, like when it is playing the button is a small speaker with sound coming out, and when it isn't playing the button just says mute or something.
Also, how is it possible for the sound to continue playing even when you go to another scene in the movie.
Thanks.
Master On/Off Audio Button For Multiple Swfs
I need to create a “master” On/Off Audio Button that will control audio for a series of swfs loaded into a “master” swf. Each loaded swf will have a Media Display or FLV Playback MP3 progressive audio file supplying audio with cue points for that imported swf.
What ActionScript would work for a “master” On/Off Audio Button in the main swf that would control audio for all of the loaded swfs so a setting in the “master” swf would effect all loaded swfs without the user needing to reset the On/Off Audio Button for each swf?
Thanks!
Mute Button For Streaming Sound
I've created a mute button for a soundobject with out any problem. But I need the sound to also stream in. This is so that the user can pause the scene and the sound using a pause button. Clicking play to resume the sound and the action on the stage keeping the two in sync. If I dont not have the sound streaming in the action on the stage is paused but the sound just keeps going. Is there a way to create a mute button that will lower the volume of astreaming sound or all the sounds? that way the sound is still moving along although not audible.
How Do I Create An On/off Button (mute) For Streaming Sound
Hi,
All I want is a simple sound on/off toggle button that can mute (not stop) a streaming sound loop. You'll notice that the attached FLA has a clip with two frames. The first frame contains a graphic with a 'sound on' icon and the second frame contains a graphic of a 'sound off' icon. So, whenever the button is clicked, it mutes the sound and alternates between the two frames displaying either the 'sound on' icon or the 'sound off' icon.
Also, keep in mind that this swf clip is loaded into a parent swf clip called "mainClip.swf".
I'm so hoping for a simple breakthrough response to this.
God bless anyone who can help me.
Kind regards,
Blastbum
How To Make Button Click Play The Last Audio Among 400 Levels?
I have 400 different audios (.swf loaded on 1 to 400 levels). My question is how to make a button on level "0" replay the last audio played on demand? (according to what user does, coresponding audio file is triggered), and it's a speech, so I need the option to repeat it. Any ideas?
Thx
Alek
Stop/Start Streaming Mp3 Sound- Button Script
I'm looking for a button script to stop a streaming mp3 sound playback on the first click, then start it again on the second click and so on.
Edited: 03/28/2007 at 02:47:48 PM by SM6601
Flash Audio Player For Streaming Audio
I am working on our church's website and am trying to add mp3 sermons for our visitors to listen to. I have a player that I downloaded but is has some problems, for some reason it will play 2 files at the same time, sometimes it says file not found and I am not sure why. I do not have the FLA file just the SWF that was on the website for download so I can't make any changes. Can anyone tell me how to make a flash audio player with play, stop, pause, rewind and fast forward buttons. Or if anyone has a sample player that I could use for my church, I need it as small as possible and do not need a playlist. Any help would be great.
F8 - Streaming Audio From Streaming Server Help
Any one have any ideas why my streaming audio wont play? I trying to stream audio .mp3's from a streaming server. This way it is not a progressive download and cache.
But I can not seem to get the audio to play through my audio player. any thoughts? Or maybe someone can point me in the right direction?
thanks!
Sound Button With Multiple Sound
Hello everyone,
I used the below actionscript for one button with one sound so how to write as3 three different buttons with three different sound?
Any help would be greatly appreciated.
Thanks,
var loadSnd:URLRequest = new URLRequest("SORTER.mp3, GUITAR.mp3, STACKER.mps");
var thisSnd:Sound = new Sound();
var sndTrans:SoundChannel = new SoundChannel();
thisSnd.load(loadSnd);
play_btn.addEventListener(MouseEvent.CLICK, playF);
stop_btn.visible = false;
stop_btn.addEventListener(MouseEvent.CLICK, stopF);
function playF(event:MouseEvent):void{
SoundMixer.stopAll();
sndTrans = thisSnd.play();
play_btn.visible = false;
stop_btn.visible = true;
}
function stopF(event:MouseEvent):void{
sndTrans.stop();
stop_btn.visible = false;
play_btn.visible = true;
How Do I Make A Multiple Button Popup Menu?
I tried to make a button, when you mouse over it a small menu motion tweens upwards with 4 other buttons on this menu. However when I mouseover the other buttons in the menu they collapse because my mouse is no longer mouse over on the first button.
How do I make the menu stay open until my mouse has left the menu? Also I want the menu to close by motion tweening downwards when the mouse leaves the area, how would I acheieve this?
Make Score With Multiple Radio Button
i just developt a quiz interactive with macromedia flash mx. i use radio button to collect my question. how to collect the true answer and then scoring them???
thanks before and appologize for my english.
harm regards,
wawan
Can You Make A Button Control Multiple Movie Clips?
Hi All -
This might be a simple answer, but I am no actionscripting guru. I want a button to control 3 different movie clips, so when clicked, it will return all mc's back to the start? This is what I have so far, and it is only reading the first action I believe.
Actionscript Code:
on (release) { trim_mc.gotoAndStop('start'); roof_mc.gotoAndStop('start'); siding_mc.gotoAndStop('start');}
Multiple Sound Events On One Button
Hello!
I don't know if its my brain that isn't working right but I have hit a blank wall so I thought i would ask you guys.
Let me set the stage.
I have - 1 Button
2 Sound clip of 12 seconds on length
and 1 sound clip of 1 second
I would like to play a one of the sound clips when the button is pressed and if the button it held for longer than the sound clip is, i would like it to start playing the 1 second clip on a loop. Then once the button is released it plays the 2nd sound clip.
I have been trying this one for a while now, can anyone help?
Also on a side note I have a crazy idea of what i would like to do with this button. I would like it to play a percentage of the sound clip and when the user releases the button for it to play the same percentage of the 2nd sound clip. Like the reving of a car engine for instance.
I have the option of doing this in AS2 or AS3, but I know AS2 better.
Audio Volume Sliders For Multiple Channels Of Audio
I don't even know if this is possible, but I was wondering if there was any way you can set up volume sliders to control multiple channels of audio. For a project I'm working on I am going to have background audio and comentary. I want the user to be able to adjust the volume of both the background audio and the comentary. Is there any was I can make seperate sliders for each of those tracks of audio?
Thanks!
SOS..help To Make Sound Button'off'
Hi Experts,
I've posted this question in the sound forum, but noone has the answer yet for me. Can anyone advice me on how to make a sound button 'off', when the user click it. I tried to put an action script on the button timeline, but it didn't allow me to..grey out. I also tried to put action script-'stop all sound' on the frame button. Also didn't work.
Is there any other way?..i've seen alot of sites that has this kind of sound off button feature. Hope anyone could help me. Wrinky
How Can I Make A Sound Button?
where can i get a tutorial or how can i make one?? a button that turns off all the sounds on the main stage?? and turns it back on???
thanks..
If You Want A Button To Make A Click Sound...
if i want my buttons to make a click sound when you rollover it, do i attach a sound effect (for instance, one of the click sounds from flashkit) to the button somehow? i'd apreciate the actionscript for this or any tips on how i go about doing this. thanks!!!
Sound Object Help - Pause Button & Multiple Mp3s
I'm trying load the mp3 externally and be able to stop, start and pause it but the pause (the pause works, just the UNpausing doesn't) isn't working. Also, if anyone has any idea how I can make this shuffle through multiple MP3s rather than just the one that would be awesome.
I'm pretty new to flash/actionscript/code so this is really just not working for me. I used a lot of it from a tutorial on here but the pause just doesn't work. I'm going to attach the fla, swf and mp3 I'm using to test it in hopes someone can fix it for me and tell me what is wrong. This is the code on the pause button... though you will probably have to download the files I'm sure:
All the files (mp3, fla, html, swf) are HERE
Thanks so much, you guys are great here.
// Pause Button
on (press) {
if (pausedx == false) {
// set variables =
pausedx = true;
playingx = false;
stoppedx = false;
// musicposition set it equal to the position/1000
musicposition = myMusicx.position/1000;
// and stop it
_root.myMusicx.stop();
} else {
playingx = true;
pausedx = false;
stoppedx = false;
myMusicx.start(musicposition);
}
}
How To Stop Multiple Instances Of Sound When You Click A Button...
AS3: Obviously, I'm a newbie
I'd like to stop my movie from playing multiple instances of a sound every time I click a button.
click button > play (3sec) sound. << i can handle that part, i think.
BUT, i'd like to check if the sound is playing...
If so, don't play a second instance of the sound.
Else, play the sound.
Does that make sense?
Thank you!!
Sound Off Button - Make It Turn Off ALL Sounds
I have an on and an off button. Apparently my problem is that it turns off all sounds, but once another button is clicked, some audio starts again... because of an onevent actionscript. I couldn't find the help I needed in flash help that someone referred to me. Does anyone know how to shut off sound globally? Then when you click again, sound returns globally?
How To I Make It Play A Sound On Button Press?
Hi, basically I want it so that when I press the ctrl button it will play a short sound, how do I do this?
I have the sound file (laserSound)
(Basically in context I am trying to follow a tutorial to make a game and ctrl makes the laser gun fire, and I would like to attach a sound to this action)
Make Button Change Sound In Each Frame
I have a movie with 300 frames where the "Say" button needs to make a different sound in each frame. Do I need to create 300 different "Say" buttons or is their an easier way?
Brett
brettabrown@sbcglobal.net
|