Simple Sound Control
I've scanned the forums for a while and have been unable to find a simple and concise awnser to createing a simple sound control panel. All I need is the action to Stop the sounds, (...stopAllSounds?) and how to start them again after the user has stopped them. Volume controls would also be apprecieated.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 05-09-2008, 12:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Simple Sound Control
I need help on a simple request. What I'm trying to do is play an mp3 file (it's duration is about a minute long) when a user clicks on a button, and when the user clicks on the button again, the mp3 would stop playing. Everytime I try to import the mp3, create a button, I can get the song to play, but I can't stop it (and it's worse if I hit the button a second time). I heard this can be done via action script, but I'm not too familiar with it. I'd appreciate any help. Thanks.
Simple Sound Effects On/off Control
I seem to be having a memory failure. I have done the 'Bouncing Ball' and in the middle frame I have put a 'Boing'. How do I use a Button to control whether someone hears the sound or not?
Sound Control With Pause Button As Well As Timeline Control
Hi there
I have a flash page, with a ambient track playing. I added a pause and play button. So you press the button then it stops, then you press it again then it plays...
So now i want to make it so that if you go to the 'WORK' page on the site, wich is on its own frame, and wich has different buttons linking to it, then i want the sound to switch off when i am on the work page as well.
So if the background ambient music plays, and you go to work then the sound switches off. Untill you switch it back on again
How is the best way for me to do that?
How To Control The Sound Volume On A Timeline Base Streaming Sound?
Hello everyone,
I have a MovieClip "Animation" with added sound as a Streaming. I have also created a Volume SiderBar which I would like to use to adjust the volume of the sound on my Flash.
The Volume SliderBar work fine and I need to some how assign the volume to the position (Value of) volume. I was wondering if someone can tell me how I can do this on a sound which is timeline based?
Thank you very much and have a great day,
Khoramdin
Sound Control Volume For Multiple Sound Objects?
I've got a file with several scenes.
Each scene has controls with different sound object defined on the first scene. There is a constant background sound object playing over all scenes. I need to control the volume of multiple sound objects playing simultaneously and setting each to different volumes from these scenes.
e.g
_root.bgmusic.setVolume(20);
_root.s001.setVolume(100);
can this be done? When I try, all sounds playing are set to the same volume.
Thanks heaps in Advance!
Sound Control Volume For Multiple Sound Objects?
I've got a file with several scenes.
Each scene has controls with different sound object defined on the first scene. There is a constant background sound object playing over all scenes. I need to control the volume of multiple sound objects playing simultaneously and setting each to different volumes from these scenes.
e.g
_root.bgmusic.setVolume(20);
_root.s001.setVolume(100);
can this be done? When I try, all sounds playing are set to the same volume.
Thanks heaps in Advance!
Sound Volume Control Using Streaming Sound In Timeline?
I am building a Flash 8 movie with animation that is synced to music in the timeline using streaming sound. At a few points I need the music to fade out and then play a video. When the video is done playing I need to come back into the timeline and have the music fade back up at the same point where it left off.
Is there a way to do this? turn down/up the volume of a streaming sound?
Simple Timeline Control Q
Hi people,
I know this is a stupid question, but I can't seem to find a working solution anywhere !?
I have a navigation MC that loads at the beginning of the main movie.
I would like the buttons in the Nav MC to affect the timeline of the main movie (move it forward etc).
I can't seem to work this out.
The references to Relative and Absolute paths I found in the Flash Help files are to do with controlling other MCs.
Cheers in advance.
Ope
Simple Movie Control
i need to go to a specific frame in a clip,
which is located in side a parent clip.
what would the code look like for going
to a specific frame in the embeded clip
from the parent clip?
thanks
Movie Control (simple I Know)
Hi there.
I've just started using flashMX and I can't get my movie control working for the life of me. I'm **** at action script. I just need some simple code to make my movie work.
When the movie loads, the movie stops and a 'play movie?' button comes up. So I need a 'play' button, a 'stop' button (for users to stop the movie) and when the movie comes to the end a replay' 'button appears.
Does anyone have any code that can make this happen???
Thanks to anyone that can help.
Simple MC Control With A Button
Can someone direct me to an example of a button that controls a MC or an object? I am trying to make buttons that will move a MC across X and Y positions without using the timeline to specify exact locations...just actionscript. I cannot find a good example anywhere online, and I know it's relatively easy..
Simple Movie Control
I'm utterly new to ActionScript and Flash, and I'm trying to make a button with a fade effect. Mouseover it and it fades in, mouseoff and it fades out. I assumed that, to do this, I would us on(rollOver) and have it play the movie clip. And in the movie clip, have it pause at a specified frame. Then on(rollOut) have it goto the frame after that frame and play it, but this doesn't work. Anyone care to give me a little help?
Simple Volume Control
Hello.
Im having a bit of a struggle understanding volume control in AS3. I have never needed to do this but now I do....So if anyone can post me some ideas on how to start off my code I would very much appreciate it.
I just want the user to click a button and the volume (in my embedded flv) to turn off and on likewise when they click it again. I have a little piece of dynamic text that also I want to say "OFF" or "ON" depending on if the volume is on or off.
Thank you very much for any insight.
V.simple Movie Control...
Could some kind person please tell me how i can control movie clips to play in sequnce.
I have several movie clips, which are all contained in the main scene, basically i just want them to play in order. ie. 'clip2' starts playing immediately after 'clip1'.
Is there some script i can put in the last frame of say 'clip1', that will go to and play frame 2 in the main time line. Then I could just put 'clip2' in the 2nd frame of the main time line, and they will play in sequence. Is this the right way to go about it?
I have tried using various bits of script to get this to work, but im a bit new to the actionscript side of flash.
Thanks...
Simple Timer Control?
hi all!
i'm looking for a script that tells the timeline to start to play frame 25, after 5 seconds.
i've found a few codes online but cos they are for different purposes, i just cant seem to custom it to work accordingly.
can someone pls help? ps: i'm using Flash 8
much appreciated!
Simple Sound Question... Not Simple For Me
Hi all, so I'm busting in here with a simple question about a sound overlapping problem - I'm no coder and certainly very unfamiliar with AS3, so any help is greatly appreciated.
I have several buttons that each link to a different external mp3 file. Problem: If audio button B is pressed after you have pressed button A (and vice versa), the audio overlaps. I have a stopallsounds button, but this does not quite solve the issue. I need each clip to play individually, no overlapping. Some swfs will have two audios clips, some as many as five or six, if that makes any difference.
This is my code which is probably extremely clunky (but error free):
Code:
//sound one
var mySoundReq:URLRequest = new URLRequest("audio/md_unexpected.mp3");
var mySound:Sound = new Sound();
var mySoundChannel:SoundChannel = new SoundChannel();
mySound.load(mySoundReq);
function playSound(event:MouseEvent):void {
mySoundChannel = mySound.play();
}
audio1.addEventListener(MouseEvent.CLICK, playSound);
//sound two
var mySoundReq2:URLRequest = new URLRequest("audio/md_change.mp3");
var mySound2:Sound = new Sound();
mySound2.load(mySoundReq2);
function playSound2(event:MouseEvent):void {
mySoundChannel = mySound2.play();
}
audio2.addEventListener(MouseEvent.CLICK, playSound2);
//stop all sounds
function stopSounds(event:MouseEvent):void {
SoundMixer.stopAll();
}
stopsound.addEventListener(MouseEvent.CLICK, stopSounds);
Sound Control Please
Hi
Can anyone tell me? Is it possible to stop the sound which has been over in first movie(swf)
And if I am loading second one to replace it. Then coming back to first movie, sound from first movie
should not play even though it has been loaded again.
1)Introduction movie has intro sound.
2)Subect movie
Both are loading on level0.
So when I load Intro movie I don't want the introduction sound to play again
Is it possible by any way putting variables somewhere in temp directory and control the movies.(just a thought)
Thanking you in advance.
Sound Control
Well short and simple. My script is this:
trackA = new Sound(this);
trackA.attachSound("trackA");
trackA.start(0,999)
trackA.setVolume(50);
now for sum reason if i have another script like this:
trackB = new Sound(this);
trackB.attachSound("trackB");
trackB.start(0,999)
trackB.setVolume(50);
if i try to fade track A out and fade B in, it will be like one is trying to control the other and will mess up. is there a way to make these independent of eachother?
Needs Serious Help With Sound Control....
Hi all,
I am not adept at actionscript at all and am hoping you flash gurus can help me with my sound problem...
I have created a flash button to control the music, I have created a movie clip that names the instance (where the movie clip with the music is)
my script is this:
Sound object script: (on the stage)
sounda = new Sound ();
sounda.attachSound(_root.sound1);
then my movie clip with the sound inside has the instance name of sound1
I progammed the off button like this: (works fine)
on (release) {
sound1.stop();
}
I put another button on the stage to restart the music and tried to script it the same as above except with:
sound1.start();
It does not turn the music back on, so what am I doing wrong?? I hope someone can help me with this, I have been searching through my many flash books but have been unable to find the answer.
Thanks so much,
Karla
Control Sound?
Hi, I realise that Flash 4 is not very good for sound management, but the problem I have is I have a presentation complete with sound the music does not need to cue to the presentation, so I have the sound file load into a separate swf (event as stream causes frame dropout) to gain some control, however when the track finishes what I want to do is to load a looping sound file also loaded into a separate swf. It appears to work apart from a time lag
Any ideas as this has taken more than a lifetime to work on!!!
Sound Control
Hi I have a problem with sound that keeps reacuring and after a while it sometimes ends up working and I don't know why? right now it doesn't. I'm trying to start to loops at the exact same time. Keeping the volume of one of them at 0 so that I can kick it in later.... here's what I got:
---------------
loop1 = new Sound(loop1);
loop2 = new Sound(loop2);
loop1.attachSound("Loop1");
loop2.attachSound("Loop2");
loop1.setVolume(100);
loop2.setVolume(0);
loop1.start(0, 999 );
loop2.start(0, 999 );
-----------------
And for some reason the sound is 0 for both..it's like as if they were the same object. I linked them as Loop1 and Loop2. Does Anyone know why this could happen???? Please help
Sound Control
I have a movie with just control buttons for an mp.3 file.
I'd like to be able to jump back and forth with the rewind or forward button to specific keyframes ( for example every 10 frames ) so, every time I push one of these buttons, it recognizes the nearest keyframe and starts again from there.
What's the script to do this?
Thanks for any help.
Stefano
Sound Control
I can control play,stop from soundfile, but without using Linkage.But using scripting ??
Sound Control?
I need little help.
I want to create movie with sound in that way that flash will "call" external MP3 file and play in specify scene and frame. For example: Scene 1, from frame 28 to frame 90 to play sound1.mp3, Scene 2 from frame 2 to frame 98 to play sound2.mp3. All mp3s are external files.
Best regards
Sound Control
hi everybobie...
does anyone noe how to turn on and off music by jus clickin on a button? and oso how to adjust the volume of the music?
thanks!
Sound Control
On _root I created a sound object:
ozadje = new Sound();
ozadje.attachSound("ozadje");
I know how to control this object from the main timeline, but I can't control it from some library instance...
I tried
_root.ozadje.start()
but it doesn't work.
What should I do?
thx
Sound Control
sound control
I am trying to fade out a sound with actionscript, without interaction from the viewer. I was going to set the volume a little lower every few frames across the timeline as a last resort, but was wondering if there was a better way to do this.
Thanks for ant time and or input, I appreciate the hell out of it...
take it easy,
g
Sound Control
I have a swf that is basically a sound (a speech of a conference), in mp3 16000Hz, mono 48kbps.
What I need is to control the play, stop, pause, rewind, foward, etc of that sound (the movie).
I´m not very experienced with action scripting son I need some help.
Thanks a lot.
Sound Control?
Hey Board! I have a quick question regarding sound control in Flash 5.
I have a soundtrak i need my movie to play on load... which i want to be able to turn off and turn on again from buttons on the main timeline. I have used the Linkage properties and newsound.attach/stop/start to control the sound as i need it to...
all seems well and fair up to this point. heres the problem: my sound will only play once without looping. now if i drag the sound onto the stage and remove my newsound.start and give the instance of my sound 500 loops. it works fine until I stop it and hit audio play (then it only plays once). My main timeline is 2 frames long (with the first being empty for my loader) and a stop action on the second frame.
QUESTION: is there a way to code something similar to a newsound.loop(500) for example???? so it will loop when its called to play and stop when its called to stop.
Thanks a bunch. Muchly appreciated.
~geoff
Sound Control
I created a movie (audio.swf) that uses sound files with a simple play and stop button. When I test this movie, it works perfectly. When I call this movie clip from the main movie of my project (main.swf) the sound clips do not play.
I am loading audio.swf on level 1 from the main movie. I am assuming that is where the confusion is taking place. Do I need to specify the path of the sound clip or something? I have tried a few different things and nothing seems to work.
Thanks for any help you can give.
be nice.
bephf
Sound Control
I created a movie (audio.swf) that uses sound files with a simple play and stop button. When I test this movie, it works perfectly. When I call this movie clip from the main movie of my project (main.swf) the sound clips do not play.
I am loading audio.swf on level 1 from the main movie. I am assuming that is where the confusion is taking place. Do I need to specify the path of the sound clip or something? I have tried a few different things and nothing seems to work.
this is the code i have attached to the play button:
on (press) {
if (playing != true) {
firstSound.start(0, 999);
playing = true;
}
}
firstSound is defined in audio.swf and linked in the library.
Thanks for any help you can give.
be nice.
bephf
Sound Control Help
ok, I have window with two arrow buttons to change songs and a dynamic text field to display the song name in a movie loaded on _level3 I have 3 different songs to choose from right now. The songs themselves are loaded on level) with the main movie in nested within movieClips to trigger a random song playing on load
Sound Control
I have managed to make a player using simple actionscript to fade between two songs. (still bit of a newbe though) ;-)
It's probably not the best way to do it, but at least it works...
but there's still one thing I have problems with.
I can't make the songs start playing right before they fade in.
If you listen to the example the songs keep playing even when they aren't used. How do you prevent that?
Similarly if I were to use the fade system in a animation, how would I script it so the songs would start playing only when they were needed, and not from the start?
Here's what I have so far:
http://www.stratyon.com/flash/shakira1.swf
http://www.stratyon.com/flash/shakira1.fla
(The sounds aren't included in the .fla or it would be 9Mb... Just add any
two sounds as event to the first frame of the sound1 and sound2 movie clips)
~Stratyon
Sound Control In MX?
Hi all,
I have a problem on my plate that I havent gotten underway yet. I need to create animations that are roughly synced with a sound file. The animation has a pause and play feature.
In my preliminary tests flash didnt stop the sound when the pause button was pushed. I cant use stopAllSounds because the play feature needs to start the sound from the point at which it was stopped. Everything with the pause/play buttons was set up correctly.
My question is...will I be able to control the playback of the sound on a timeline like i would be able to if it were a regular flash MC or say...an embedded quicktime movie.
Or...
Do I need to set the sounds up as objects and control the sound with script.
It seems like the first should work, but so far it doesnt.
Any help would be much appreciated.
-P.
Help With Sound Control
I have more than 1 swf movie and i'm controlling the transitions between them using unload(the current movie) and loadmovie(the movie i want to show next) so far so good, the problem is that i'm using sounds in some symbols of a movie that play well the first time and if i change to the next swf and them return to the previous one using the method i previous explain the sounds don't work anymore, although the animations from those symbols still work.
i'm playing the sounds this way:
on (press) {
stopAllSounds();
som =new Sound()
som.loadSound("Fala_Mascote_2_Pulmoes_v2.mp3");
som.start();
}
I'm using flash MX
Can anyone help me? I really be thankfull...
Help With Sound Control
hi i made, a external swf which i load into my main swf.
within the external one i have used attachsound to attach my tune and i also have play stop and volume control this all works fine.
then i tried to place preloader on this but it didnt work as the sound was loading before the preloader.
if i dont use attach sound and just place this sound in a frame will i still be able to control volume and on off buttons.
is there an easy way too do this??
thanks
brian
Sound Control
Ok what i have done is made a flash movie with looping background
music and what i want to do is make a button to turn off
the background music and play another song but not
looping the other song just every time you click on the
play button it start over.
i hope that makes since
please help
thx in advance
XxGraphxX
Sound Control
I am building a Flash production that will be presented on a CD.
A flash movie loads a second Flash movie that has a Quicktime movie with a sound track.
After the second movie plays, it loads back to the first Flash movie.
Problem is the QuickTime sound track from the second Flash movie keeps playing.
Can anyone tell me the required ActionScripting necessary to have the QuickTime sound track not continue playing?
Flash MX used.
Sound Control
I've got a file with several scenes. Each scene has controls different sound object defined on the first scene. There is a constant background sound object playing over all scenes. I need to control the volume of multiple sound objects playing simultaneously and setting each to different volumes from these scenes.
e.g
_root.bgmusic.setVolume(20);
_root.s001.setVolume(100);
can this be done? When I try, all sounds playing are set to the same volume.
Thanks,
Sound Control?
I've got a file with several scenes. Each scene has controls different sound object defined on the first scene. There is a constant background sound object playing over all scenes. I need to control the volume of multiple sound objects playing simultaneously and setting each to different volumes from these scenes.
e.g
_root.bgmusic.setVolume(20);
_root.s001.setVolume(100);
can this be done? When I try, all sounds playing are set to the same volume.
Thanks,
Sound Control
I'm going crazy!!!!!
I forgot how to control a sound that is contained in a movie that was loaded to a target object in the timeline using "load movie".
Here's my goal:
I have several external MC's that can be loaded as "Background Themes" which contain graphics and sound. The viewer can select each of these via a menu. The external MC is then loaded to a target object on the timeline. I also want the viewer to be able to turn the sound On and Off of the selected MC from the same menu.
The menu is of the "Drop Down/Pop-Up" type which is a MC contained in the Root. I can select the different MC fine with this menu but I just can't get the type of control I want for their sounds. (ON/OFF)
How do I code this to make it possible?
TIA
Sound Control
I already no how to attach a sound loop from the gallery using:
Code:
mySound = new Sound();
mySound.attachSound("SOUNDLOOP");
mySound.start("", 9999);
But what i want to do is have two buttons one for stop and one for play BUT i dont want them to actualy stop the music.
What i want to do is have it so when u hit stop it takes the volume down to 0 and then when u hit play it takes it back up to 100 so its like the loop fading in and out with a contant stream.
Any ideas on this ??
Thanks, Mental
Sound Control
Hi,
I just finished playing with one of the tutorials:
Volume & Pan Slide Controls
Author: Joe Jabon
http://www.flashkit.com/tutorials/Au...-721/index.php
it works great, but....
how do I set the start volume to 50% as it always starts at 100%
I cant seam to find anywhere to modify the sound.
HELP!!!
Thanx in advance
Sound Control Via AS
Hi,
I've been trying to get Flash MX to play a sound via AS, and the problem I've been having is that the sound will only play if it is already previously included in the timeline (via the properties panel). I've included an example file of what I'm talking about.
The "static" sound begins on the timeline on frame 3, and it begins again via AS on frame 31. However, if I remove the sound on frame 3, the one on frame 31 won't play.
Also, if I change the "start" of frame 31 to "stop" and move the AS back to, say, frame 6, it stops the sound which had begun on 3. So the code is working...I just have no clue why I should need anything on frame 3.
Please help me if you can.
Thanks,
aaroneousmonk
PS. I've already tried the "Sounds" forum, with no reply.
Sound Control
Hi everyone,
I'm controlling a fade out using actionscript for one particular sound object. But it's affecting all the sounds, even though they haven't been made into sound objects.
Thanks in advance
Rob
Sound Control
Hi,
I have some problems with sound. I dont know how to solve a problem with start end stop a sound. In menu I have few video clips, and before a clip i put StopAllSounds. Problem is how to start a sound after the clip without overplaying? I need to have a script which will stop a sound on video play, which will recognize a end of the video and which will start a sound from the stoping point.
Anyone knows how to do that or have a allready a fla with similar problem?
Thanks
Sound Control
I have multiple movie clips placed along my main timeline. A user can navigate with a navigation bar on the left or with two buttons on the bottom "before" and "next". Everything is working great.....EXCEPT, I have sound in each movie clip and when the user skips around all my sounds are overlapping.
The solution to this seems rather simple - but I can't seem to figure it out. I do not want to use a StopAllSounds function because on the main timeline I have some background music looping. I just want to stop all sounds within a movie clip when someone clicks a button from the main timeline.
I've placed a .zip file on my server to show as example. If you someone can figure this out in my .fla file - I would soooo appreciate it if you could e-mail me back a .zip file with the solution.
My e-mail address is jackie@envisionwise.com
Thank you!
Jackie
The File you can download is http://www.envisionwise.com/mocks/0_test/soundhelp.zip
Sound Control
Hi, I would need some help with my first Flash site. I have a problem with preloading sound. When I start to preload the site the first frame is too big and the preloading movie is not shown immediately but after some time. When I do it with the attachSound method I can control the sound but it loads into the first frame.But when I add the sound to a specific frame I can't find any way to control it. Could anybody help me.
Sorry for my English
Thank's
Sound Control
hey,
i am making a flash jukebox i have actually made a fairly decent one before but on this one i am using a sound control bar which i downloaded from here, but i have added it to my .fla but it isnt working the actionscript is
onClipEvent (load) {
_parent.volSlider.drag._x += 50;
}
onClipEvent (enterframe) {
vol = _parent.volSlider.drag._x+50;
_parent.mySound.setVolume(vol);
_parent.volAt = Math.round(vol);
}
is there anything wrong with this or do i have to edit some of it?
|