SetVolume
I set up 3 buttons for the sound, they are 100(loud), 75, and 0(mute). When I run the movie, it was working fine at the first time when I press the mute button. After that, while I am reviewing my other pages, the sound comes back, and the mute button still on. Below is the code, please help, thank you in advance.
var my_sound = new Sound();
my_sound.loadSound( "music/night.mp3", true );
my_sound.onSoundComplete = function() {
my_sound.loadSound( "music/night.mp3", true );
};
b_1.enabled = 0;
b_1.gotoAndStop( "disabled" );
b_1.onRelease = function(){
reset_sound_buttons();
this.gotoAndStop( "disabled" );
this.enabled = 0;
my_sound.setVolume( 75 );
};
b_2.onRelease = function(){
reset_sound_buttons();
this.gotoAndStop( "disabled" );
this.enabled = 0;
my_sound.setVolume( 100 );
};
b_mute.onRelease = function(){
reset_sound_buttons();
this.gotoAndStop( "disabled" );
this.enabled = 0;
my_sound.setVolume( 0 );
};
reset_sound_buttons = function() {
b_1.enabled = 1;
b_1.gotoAndStop( "_up" );
b_2.enabled = 1;
b_2.gotoAndStop( "_up" );
b_mute.enabled = 1;
b_mute.gotoAndStop( "_up" );
};
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 11-05-2005, 02:43 AM
View Complete Forum Thread with Replies
Sponsored Links:
SetVolume
Well, right to the point.. I have a loop playing using the sound object.
music = new Sound(music);
music.attachSound("music");
music.start( 0, 500 );
Now, at a certain point on the time line i have a normal event sound just using the regular needle graph on the timeline. Now, at the time the event sound plays, i have the setvolumes for the sound object decresing by 5. 95 through 0% volume. But this is also controlling the needle graph event sound with it. Is there a way to stop this?
View Replies !
View Related
SetVolume
here is the code : of a button
on(press,release){
//I have a MC that I move according to
//the mouse position
_root.music_MC.songs_MC.volume_MC.volumescroller_M C._x = _xmouse -59 ;
//then I want the volume to be set according to
//the MC position (I move the MC from x=-136 to x=-37)
for(i=0;i<100;i++){
if(Math.round((_xmouse -59 +136)*0,99) == i){
_root.mysound.setVolume(i);
}
}
}
//but the sound just stops when I move the MC
Can anyone please help me or tell me a better method
View Replies !
View Related
SetVolume Bug?
FK cut off half of my post so I'll try again...
I've assigned the following script to the root of my movie:
Music1 = new Sound ();
Music1.attachSound("Music1");
Music2 = new Sound ();
Music2.attachSound("Music2");
stop();
View Replies !
View Related
SetVolume Changes Vol For All Instead On One
I'm trying to use setVolume() to set the volume for my background music. However, changing my background volume is changing it for all sound objects.
I've tried placing the code to start the background music in its own mc, and specifying the exact target to that mc in the setVolume, as I found a coulpe of posts that suggest that doing this might be the answer to adjusting each sound oject separately. No luck.
All of my sound objects are like:
_root.mysound01.start()
My background music is like:
_root.musicvol.backgroundmusic.start()
Any ideas? Thanks.
View Replies !
View Related
SetVolume
Can anyone make a volumecontrol with 5 buttons: 100%, 75%, 50%, 25% and Off? So that I can import it into my project? It must control every sound in the prosject. I've tried to make one, but without luck.
I've attached a file that works, but it dosen't work the way I want to an another application I'm making.
I'm making a piano you van play on. And every note at the piano have different buttons with different values and of course different sounds that the soundcurve (see attached file) is getting drawn out of. What I want is: when I click for example on 50% and tone C I want the curve to be drawn with right values(this works) and the volume to go to 50%.
In the attached file it's only 1 sound, and thats not how I want it. I want differnet sounds to different tones(or tangents, I'm not sure what the english word is for the buttons on the piano).
The buttons on the piano is in this file green buttons.
The original file was to large to attach, that's why I attached this one.
Please help me?
Best regards
Raymond
ray_81@yahoo.com
View Replies !
View Related
SetVolume
Can anyone make a volumecontrol with 5 buttons: 100%, 75%, 50%, 25% and Off? So that I can import it into my project? It must control every sound in the prosject. I've tried to make one, but without luck.
I've attached a file that works, but it dosen't work the way I want to an another application I'm making.
I'm making a piano you van play on. And every note at the piano have different buttons with different values and of course different sounds that the soundcurve (see attached file) is getting drawn out of. What I want is: when I click for example on 50% and tone C I want the curve to be drawn with right values(this works) and the volume to go to 50%.
In the attached file it's only 1 sound, and thats not how I want it. I want differnet sounds to different tones(or tangents, I'm not sure what the english word is for the buttons on the piano).
The buttons on the piano is in this file green buttons.
The original file was to large to attach, that's why I attached this one.
Please help me?
Best regards
Raymond
ray_81@yahoo.com
View Replies !
View Related
SetVolume Help
alright I have the script
Dilema = new Sound();
Dilema.attachSound("Dilema");
Dilema.start(0, 9999);
Dilema.setVolume(2);
stop();
but theres a problem! not only does it set the volume for that song to 2, it sets the volume of all the sound effects that is less than 2 levels away from the home.swf
the mplayer.swf is loaded into the home.swf and thats where the song is, the menu.swf is also loaded into home.swf and its sound effects are going out at volume - 2. whats the deal?
View Replies !
View Related
SetVolume Of A Swf?
I'm loading in a wav file that is embeded in a swf, simply because I can get better compression that in an externally loaded mp3.
anyone know how I can set the volume of it from my main swf, I dont think the sound.setVolume() will work because I'm not loading int he sound that way
View Replies !
View Related
SetVolume
I have some movie clips on my stage that I would like to have diffrent Volumes. When I add the following actionscript I get undefined for all three of my traces. Any idea what is going on?
_root.setVolume(100);
_root.audioMC.setVolume(70);
_root.loopMC.setVolume(10);
trace(_root.getVolume());
trace(_root.audioMC.getVolume());
trace(_root.loopMC.getVolume());
View Replies !
View Related
SetVolume() WTF ? Please Please Help
heeeelo people !
Big Big Problem !
straight to the point
i have created new sounds :
sound1 = new Sound();
sound2 = new Sound();
sound3 = new Sound();
sound1.attachSound("audio1");
sound2.attachSound("audio2");
sound3.attachSound("audio3");
then started all three :
sound1.start(0,999);
sound2.start(0,999);
sound3.start(0,999);
then tried to adjust the first volume to 50 :
sound1.setVolume(50);
And WTF ?! all 3 sound's volume are now 50 !?!
pleeeeease please help ! it's very so many important to me !
peace .
(if it's not clear i can attach an example file)
View Replies !
View Related
SetVolume() ?
Hi,
i have created two sound objects and attached sounds to them.
I started both sound. Now i want to control the volume of each sound seperately using the setVolume method (on release of a botton for now).
Hereunder i place the script of the botton, which is supposed to set the volume of the sound object 'B2' to 10. But instead it sets the volume of ALL sound to 10 (in this case B1 and B2).
// script attached to a botton
on (release) {
B2.setVolume(10);
trace("B2 volume = " + B2.getVolume());
trace("B1 volume = " + B1.getVolume());
}
// frame script creating 2 sound objects
// and attaching sounds to them
// and some attributes to be used later
B1 = new Sound();
B1.attachSound("B1");
B1.name = "B1";
B1.laenge = B1.duration;
B1.offset = 0;
B1.loop = 1;
trace(B1.name);
trace(B1.laenge);
B2 = new Sound();
B2.attachSound("B2");
B2.name = "B2";
B2.laenge = B2.duration;
B2.offset = 0;
B2.loop = 1;
trace(B2.name);
trace(B2.laenge);
// function to start sounds
function startsounds () {
B1.start(0,10);
B2.start(0,10);
}
// staring the sounds when movie gets loaded
onLoad = startsounds();
You can take a look to the SWF
http://www.phlux.org/flash_test/setVolume/test.html
Download the FLA here
http://www.phlux.org/flash_test/setVolume/test.fla.sit
Could anybody tell me what's wrong please?
Thanks,
kokoloko
View Replies !
View Related
SetVolume
Hi guys
Is it possible to fade out a sound without affecting other sounds that may be playing at the same time? eg. have background music fade out but keep other sounds working as normal?
The reason I ask is because I always thought that setVolume works for each object that you apply it to individually. But in my code this doesn't seem to work. The following code:
Code:
var flicka:Sound = new Sound(this.frontsigns.lamp);
flicka.attachSound("flicker");
flicka.setVolume(0);
var music:Sound = new Sound(this);
music.attachSound("carMusic");
music.start();
...mutes everything. If I remove the setVolume it works just fine. So is setVolume a global setting?
Cheers!
View Replies !
View Related
SetVolume() Crossfade
Greetings!
I've been having problems with the Sound object.
More specifically, I would like to crossfade two sounds. The first sound I loaded and linked as a sound object and is looping for the bulk of the movie. When the user enters the last part of the main timeline, an embedded movie should fade out the first loop while fading in the final music clip. Here is the code I put in the embedded movie:
---------
Frame 1:
vol = 100;
_level0.endmusic.start( 0, 0 );
Frame 2:
if (vol > 0) {
_level0.mainmusic.setVolume( vol );
_level0.endmusic.setVolume( 100 - vol );
vol = vol - 1;
} else {
stop ();
}
Frame 3:
gotoAndPlay (2);
---------
I have already attached the sounds in the main timeline and linked the symbols in the library for exporting.
mainmusic = new Sound();
mainmusic.attachSound( "mainloop");
endmusic = new Sound();
endmusic.attachSound( "end");
Now the problem I'm having is that the setvolume command in frame 2 sets both sound files to the fadein command. If I reverse the order of the setvolume lines, both sounds will fade out.
I was under the impression that you could control individual sound elements with the setvolume() method. This seems to apply it to all sounds globally.
Any help would be appreciated. Thanks.
View Replies !
View Related
Please, Help Me With SetVolume&setPan
I have a problem in my flash moovie with those two commands.
I have two sound objects, and the target is to create sound, where one sound stays static and onother one changes in Volume and Pan.
So.. I have two sounds, lets call them sound1 and sound2
In first frame of main scene I have script:
Seaside = new sound();
Seaside.attachSound("sound1");
Seaside.start();
Then in different moovie clip I start to manage with second sound:
SecondSound = new sound();
SecondSound.attachSound("sound2");
SecondSound.start();
SecondSound.setVolume(0);
SecondSound.setPan(-100);
Untill this ****ing moment everything is just fine, but here setVolume and setPan is affecting not just sound2 but sound1 also changes it's propertys.
Oh people please help, this sound should be excellent, I just have to get over this ****
Thankyou in advance!
View Replies !
View Related
Augh, Help Please With SetVolume()
i dont understand this, i have a sound called sound1. through actionscript, im changing the volume depending on whats going on using sound1.setVolume(whatever); the thing is, for some reason this universaly sets the volume to all other sounds. so if the volume for sound1 is off, so is the volume for any other sound that i have. anyone know how to fix this? thanks.
View Replies !
View Related
Values Of SetVolume
Hi!
I'm using SetVariable() but I don't know the way the values works.
What's the minimum and the maximum number? Form max. to min. or from min. to max.?
Thanks
www.motardzone.com
View Replies !
View Related
SetVolume Problem
CAN SOMEONE TELL ME WHY THE VIDEO VOLUME IS GETTING TURNED OFF AS WELL AS THE MP3 TRACK?
+STORY UP TIL NOW+
I've built an external mp3 player that plays 4 tracks by calling functions like this:
function air() {
snd_air = new Sound();
snd_air.attachSound("air");
snd_air.start();
snd_air.onSoundComplete = air;
snd_air.setVolume(80);
in the main timeline of the 'mother' fla. the player swf is loaded into the mother swf and is basically just 4 frames with stop commands and with actions like:
_root.snd_air.stop();
_root.snd_air.start();
on play and stop buttons and:
nextFrame();
on the cue buttons
this all works fine throughout the site, EXCEPT on the video page where I'm trying to toggle the volume off when someone plays an embedded video
++PROBLEM++ ++setVolume command turns off the video volume as well as the mp3 track!!!++
I put these functions on the main timeline of the mother fla:
function soundoff() {
_root.snd_air.setVolume(0);
_root.snd_cocteau.setVolume(0);
_root.snd_beats1.setVolume(0);
_root.snd_beats2.setVolume(0);
}
function soundon() {
snd_air.setVolume(100);
snd_cocteau.setVolume(100);
snd_beats1.setVolume(100);
snd_beats2.setVolume(100);
}
and attached this script to the play button of the embedded video, which called into the 'mother' swf in the same way as the mp3 player:
on (release) {
_root.soundoff();_root.content.j5.playing = true;
if (_root.content.j5.playing == true & _root.content.j5.end == false) {
play();
} else if (_root.content.j5.playing == true & _root.content.j5.end == true) {
_root.content.j5._currentframe = 1;
_root.content.j5.gotoAndPlay(2);
}
}
What's the problem? Could someone pleeeeeze help me cos this is for my final potfolio which is due next week!
Thanks in advance guys
View Replies !
View Related
SetVolume Not Working
i'm trying to set the volume of this button sound, but it's not working at all. I even set the volume to 0 and then trace it back using getVolume(), which returns the correct value, but the volume still sounds like it is at 100%. here's my code:
Code:
var buttonSound:Sound = new Sound();
buttonSound.setVolume(0);
buttonSound.attachSound("button_sound.wav");
// test code
trace("volume: " + buttonSound.getVolume());
also i'm calling the sound using this: _root.buttonSound.start();
any ideas?
View Replies !
View Related
MX2004 - Bug In SetVolume
Hi,
This is really annoying, there is a irritating bug with SetVolume, and this is not the first time it happens to me...
If you attach two different sounds from library, both will have their volume affected by the last setVolume command, this way:
PHP Code:
sndUnderWater = new Sound(this);
sndUnderWater.attachSound("underwater");
sndUnderWater.setVolume(100);
sndUnderWater.start(0,999);
sndUnderWater.onSoundComplete = function()
{
sndUnderWater.start(0,999);
}
sndSonar = new Sound(this);
sndSonar.attachSound("sonar");
sndSonar.setVolume(10);
sndSonar.start(0,999);
sndSonar.onSoundComplete = function()
{
sndSonar.start(0.1,999);
}
both will have their sounds set to 10!!!
Argh!!!
View Replies !
View Related
SetVolume Question
hello.
i have a background track playing in my site and want the volume of the track to fade out when an .flv is playing. i've got that, BUT the volume of my .flvs are also affected.... ?
i have the track in a seperate MC:
this.theTrackObject = new Sound();
this.theTrackObject.attachSound("myTrack");
this.theTrackObject.start("myTrack", 99999);
and then call it with this:
_parent.theTrackObject.setVolume(0);
all of this works fine, but it also turns the volume of my .flvs to zero too.
any help would be greatly appreciated.
cheers.
View Replies !
View Related
Problems With SetVolume()
Hi,
I have a problem with controlling sound in my movie. I have an attached sound called “music” which plays in the background on a loop. I also have a video in the page that plays when asked to and I basically need to fade the music out as the video starts to play so you can hear what is going on, then fade it back in again when the video finishes.
I have made some code up to control the volume of the attached sound called “music” which does actually work. The problem I actually have is that when I tell the attached sound what volume to play at using “music.setVolume()” it takes the volume of the video to the same level with it.
I have no idea why this is happening at all because I am specifically telling the attached sound to change its volume not the embedded video in the page.
Does anybody have any idea why this is happening or even better how to solve it?
Many thanks,
Ritchie
View Replies !
View Related
SetVolume Isn't Working
I need serious help. I'm creating a sound object and attaching a sound effect to it. When it plays it's too loud so I used setVolume to lower the volume but it doesn't work. Even when I say mySound.setVolume(0) it still plays the damn sound when I call mySound.start(0,1). Please does anyone know why this happens?
View Replies !
View Related
SetVolume() Issue
Weird problem. I've used sound objects a million times without any problem, but I've never done it where I have some sound streaming on the timeline AND some being played through an object.
I have the following code...
Code:
_root.bgMusic = new Sound();
_root.bgMusic.attachSound("bgMusic");
_root.bgMusic.start(0,999);
_root.bgMusic.setVolume(100);
_root.volumeVar = 100;
_root.fadeMusic = function()
{
trace("in");
_root.bgMusicInterval = setInterval(_root.fadeVolume, 100, 5);
}
_root.fadeVolume = function(amount)
{
trace(_root.volumeVar);
if(_root.volumeVar > 0)
{
_root.volumeVar -= amount;
_root.bgMusic.setVolume(_root.volumeVar);
}
else
{
clearInterval(_root.bgMusicInterval);
_root.bgMusic.stop();
}
}
...which works fine when I call the fadeMusic() function. The sound object fades at 5% every 100ms just as you'd expect. What's unusual is that the audio that is on the timeline is also being scaled down.
Any ideas?
View Replies !
View Related
SetVolume Issue
flash CS3 / AS2
I've got as far as I can get but still having issues:
I want to get/use data from the mic but I dont want to hear this data from the speakers. I have sound playing and i want to hear from the speakers at the same time the muted data from the mic is being used...
I've used setVolume for both the mic(at 0) and sound(at 100), but both act as if they are muted. Could someone please help, im nearly there.
stop();
s1 = new Sound(_root);
s1.attachSound("sound1");
s1.start();
s1.setVolume(100);
m = Microphone.get();
_root.attachAudio(m);
m.setSilenceLevel(40);
micSound = new Sound(_root);
micSound.setVolume(0);
m.onActivity = function(mode) {
gotoAndStop("frame2");
}
Thanks for your help
Chris
View Replies !
View Related
SetVolume Not Working
I have .wav sound clips in the flash library that I've set linkages on. I'm using the following:
this.createEmptyMovieClip("profileContainer_mc", this.getNextHighestDepth());
this.profileContainer_mc.createEmptyMovieClip("pro file_mc", this.getNextHighestDepth());
profileMCL.loadClip("profiles.swf", "profileContainer_mc.profile_mc");
$loop_intro = new Sound(profileContainer_mc.profile_mc);
$loop_intro.attachSound("v8_116"); // linkage identifier
$loop_intro.setVolume(20);
$loop_intro.start(0, 999);
---------------------------------------
The sound plays fine. I can stop it and start it but the setVolume() does not alter the sound in any way. I've tried publishing it and viewing in a browser as well as the standalone flash player and neither works.
Any ideas? TIA
-sean
View Replies !
View Related
SetVolume On Mouse_move
hi I have a spectrum analyzer being drawn around a ball. you can see it here --> http://ostari.com/ronnie/spectrum/leespec.swf
Right now if you put your mouse closer to the center of the ball the volume decreases and the further away from the ball it increases. So I want to do that same exact effect except the complete opposite. The closer to the center of the ball the louder it gets and the further away the quieter it gets. Here is the code I am using right now:
ActionScript Code:
//BALL1
var s:Sound = new Sound();
var sc:SoundChannel;
var ba:ByteArray = new ByteArray();
var array:Array;
s.load(new URLRequest("mix2.mp3"));
sc = s.play(0,1000);
function setVolume(volume:Number):void {
trace("setVolume: " + volume.toFixed(5));
var transform:SoundTransform = sc.soundTransform;
transform.volume = volume;
sc.soundTransform = transform;
}
function checkMouse(xpos:Number) {
var xpos = this.mouseX/90;
setVolume(xpos);
}
this.addEventListener(MouseEvent.MOUSE_MOVE, checkMouse);
this.addEventListener(Event.ENTER_FRAME, spectrum);
var a:Number = 0;
function spectrum(event:Event) {
a = 0;
graphics.clear();
SoundMixer.computeSpectrum(ba,true,0);
for (var i=0; i < 256; i=i+8) {
a = ba.readFloat();
var num:Number = a*360;
graphics.lineStyle(num/15,0xccff33|(num << 8),5);
graphics.drawCircle(0,0,i);
}
}
any help is much appreciated..thanks!
View Replies !
View Related
Music1.setVolume(X)
Hey nice guys, it is my first message at this forum, and it is a simple one:
How can I control the volume of the multiple Sounds objects in my movies?
i.e.: I want when the user press the button "SPEAK" the volume of the music be lowered to 10 and the voice volume be increased to 100. I used this:
on(release) {
music1.setVolume(10);
voice1.setVolume(100);
}
but it doesn't work because the volume seems to be one global thing. I know it is possible to control sound, but I can't do this. Can someone help me on this affair?
I will appreciate any trying )
Thanks in advance!
View Replies !
View Related
Can't Get SetVolume To Stick
I've got an array of some songs that I'm using as a soundtrack for a "slide show." I've created a sound object and and loading the songs as streaming external files. For some reason everytime I load a song it is resetting the volume to 100. Anybody have any ideas why this would happen?
Oddly enough the code below generates these traces:
onLoad volume is 100
setting volume to 3
onComplete volume is: 3
onLoad volume is 3
setting volume to 3
loading song #1
onLoad volume is 100
setting volume to 3
I'm not clear why I'm getting and onLoad once with the correct volume and then the trace for loading song and then another onLoad with the volume reset to 100. It is very strange.
Attach Code
var sndTrackClip:MovieClip = this.createEmptyMovieClip("sndTrackClip", 100);
var sndTrack:Sound = new Sound(sndTrackClip);
var theSongs:Array = ["HelloJudy", "InkSpots", "Bing"];
var curSong:Number = 0;
theSongs = shuffle(theSongs);
sndTrack.onSoundComplete = function() {
trace("onComplete volume is: "+this.getVolume());
sndTrack.loadSound("snd/"+theSongs[curSong++]+".mp3",true);
trace("loading song #" +(curSong-1));
};
sndTrack.onLoad = function() {
trace("onLoad volume is "+this.getVolume());
this.setVolume(3);
trace("setting volume to "+this.getVolume());
};
sndTrack.setVolume(20);
sndTrack.loadSound("snd/"+theSongs[curSong++]+".mp3",true);
View Replies !
View Related
SetVolume Problem
Hi all
usually i can find the solutions of the problems i have in this great forum.....but this time....i guess i really need to ask
okay, i have a flash document that contains two wav file in the library with ID name "soundloop1" and "soundloop2". and there is no other stuff except for the following code on the first frame:
_root.mySound1 = new Sound(mc1);
_root.mySound1.attachSound("soundloop1");
_root.mySound1.start(0, 50);
_root.mySound2 = new Sound(mc2);
_root.mySound2.attachSound("soundloop2");
_root.mySound2.start(0, 50);
_root.mySound1.setVolume(20)
_root.mySound2.setVolume(100)
trace(_root.mySound1.getVolume())
how come the output is 100(and it sounds like 100 too...pretty loud ) ?? what did i do wrong?
thanx in advance
View Replies !
View Related
SetVolume Issues
Ok, so adding some sound to the web site, all is nice and good - I can get it to play just fine. Now the primary background sound I want to be a very low volume, so you can hear the various button effects that are all working already as well.
I am using the setVolume command to just set the BG volume to a low level, lets say 15, as seen below, strange part is, it has NO effect and the volume just plays at the normal clip levels.
Suggestions? Code:
Code:
// BG Sound Controller
var bgSound:Sound = new Sound();
bgSound.attachSound("mainSound");
bgSound.start(0)
bgSound.setVolume(15);
View Replies !
View Related
SetVolume Problem
I am using a simple onEnterFrame function and decrementing the value of a variable named myVolume. When myVolume reaches 0, an action occurs. The action occurs, so the condition if(myVolume == 0) must be satisfied, and yet, although the volume of the background music has indeed lowered substatntially, if I turn up my computer's speakers I still hear the music playing (just at a lower level).
I have checked to make sure the track is not playing anywhere outside of the flash app.
If a sound object's volume is set to 0, shouldn't the sound be completely off?
Thanks.
View Replies !
View Related
SetVolume() Issues
I’m having an issue with the setVolume() function.
My problem is that when I set volume of a specified sound object the entire flash file is affected, meaning that all sounds are affected (The ones created by AS). Not just the single sound I specified.
Here’s the line, which "mutes" the sound:
Code:
music_main.setVolume(0);
The ‘music_main’ object is created through these lines:
Code:
music_main = new Sound();
music_main.attachSound("MAIN_THEME");
Now my problem is what I stated above. All Sound Objects created are affected by the setVolume() function. I only want to change the ‘music_main’ object.
Any ideas?
Thanks in Advance...
View Replies !
View Related
SetVolume() For ALL Sounds
I can set volume for one sound, but if I have a sound board type thingy with 50 sounds, is there a way to set the volume for all sounds? I won't have easy access to control the external speakers sounds and so far I can only find a way to control each sound. I don't want to write that function and copy it 50 times for each sound.
I am hoping there is something like stopAllSounds, but more like setVolumeForAllSounds()
View Replies !
View Related
Setvolume Command
Hello,
I'm trying to set the volume for a loop of music. However, I want the user to input the value for the volume. I created a textbox and gave it the variable name [vol]. I set the setvolume command as [bg.setvolume.(vol)] where bg is the name of the sound loop I imported. However, when I type in the input, the input isn't recieved by the setvolume command. The only way the command works is if the value is placed in the text box before I run the movie, not if I place the value when running the movie.
Is there any way I can place the value when running the movie so that the setvolume command takes it in?
Thank you for your time... appreciate it.
View Replies !
View Related
SetVolume Problem
Hi all
usually i can find the solutions of the problems i have in this great forum.....but this time....i guess i really need to ask
okay, i have a flash document that contains two wav file in the library with ID name "soundloop1" and "soundloop2". and there is no other stuff except for the following code on the first frame:
_root.mySound1 = new Sound(mc1);
_root.mySound1.attachSound("soundloop1");
_root.mySound1.start(0, 50);
_root.mySound2 = new Sound(mc2);
_root.mySound2.attachSound("soundloop2");
_root.mySound2.start(0, 50);
_root.mySound1.setVolume(20)
_root.mySound2.setVolume(100)
trace(_root.mySound1.getVolume())
how come the output is 100(and it sounds like 100 too...pretty loud ) ?? what did i do wrong?
thanx in advance
View Replies !
View Related
SoundObject >>> SetVolume
Is the sound object "outDoors" indepenent from the setVolume of 17? If not how can I make that sound object have it's own volume setting? When I add outDoors.setVolume(100); it effects all sounds for a second until my other functions kick in.
ActionScript Code:
fairyTailz = new Sound();
fairyTailz.attachSound("loop");
fairyTailz.setVolume(0);
outDoors = new Sound();
outDoors.attachSound("nature");
// --------------------------------------------------------------------------------------
fairyTailz.fadeIn = function(speed) {
var vol = this.getVolume()+speed;
this.setVolume(vol);
display = this.getVolume();
if (this.getVolume()>17) {
this.setVolume(17);
clearInterval(this.interval);
}
};
fairyTailz.fadeOut = function(speed) {
var vol = this.getVolume()-speed;
this.setVolume(vol);
display = this.getVolume();
if (this.getVolume()<0) {
this.setVolume(0);
this.stop();
this.playing = false;
clearInterval(this.interval);
}
};
sndBtnOn_mc.onPress = function() {
if (!fairyTailz.playing) {
fairyTailz.start(0, 999);
clearInterval(fairyTailz.interval);
fairyTailz.interval = setInterval(fairyTailz, "fadeIn", 500/12, 1);
fairyTailz.playing = true;
}
};
sndBtnOff_mc.onPress = function() {
if (fairyTailz.playing) {
clearInterval(sndObj.interval);
fairyTailz.interval = setInterval(fairyTailz, "fadeOut", 200/12, 1);
}
};
// --------------------------------------------------------------------------------------
fairyTailz.start(0, 999);
fairyTailz.interval = setInterval(fairyTailz, "fadeIn", 500/12, 1);
if (!fairyTailz.playing) {
fairyTailz.start(0, 999);
clearInterval(fairyTailz.interval);
fairyTailz.interval = setInterval(fairyTailz, "fadeIn", 500/12, 1);
fairyTailz.playing = true;
}
outDoors.start(0, 2);
View Replies !
View Related
SetVolume() Issue
I'm having a problem setting volume of setVolume doesn't seem to work? I've tried moving the setVolume line up and down the function, hoping that the order of things might help, but nothing seems to work. I don't get it!!!
Here is the code I'm currently using.
function BGClock(idname,vol) {
this.createEmptyMovieClip("clock", 3);
clock.bgsound = new Sound(clock);
clock.bgsound.attachSound(idname);
clock.bgsound.start(0, 9999);
clock.bgsound.setVolume(vol);
}
BGClock("clock",10);
Thanks for any help.
View Replies !
View Related
SetVolume() Issue
I'm trying to create a random sound environment, in which random sounds are played at random volumes ( to give it some sort of depth).
The problem i am having is that when I use setVolume() on any of the sound objects that are created randomly, it effects the volume over everything for some reason.
example: example
Any help would be appreciated, because i just don't get it
Code:
soundlist = new Array("bird", "car1", "car2", "car3", "carhorn1", "carhorn3", "cat", "crow", "doorbell", "gun", "hammer", "motorcycle", "sparrow", "thumpin");
soundLevel = 5;
function MouseDown(idname) {
mysoundobj = new Sound(this);
mysoundobj.attachSound(idname);
mysoundobj.setVolume(100);
mysoundobj.start();
}
function PlaySound(idname) {
soundLevel++;
var ranvol = random(20) + 5;
soundx = new Sound(this);
soundx.attachSound(idname);
soundx.setVolume(ranvol);
soundx.start();
soundx.onSoundComplete = function() {
delete soundx;
};
}
function RandomSound() {
var testnum = random(1000);
if (testnum > 850) {
var x = random(soundlist.length);
PlaySound(soundlist[x]);
}
}
function BGSound(idname) {
bgsound = new Sound(this);
bgsound.attachSound(idname);
bgsound.setVolume(10);
bgsound.start(0,9999);
}
function StopSound (){
clearInterval(intervalID);
bgsound.setVolume(0);
}
function StartSound(){
intervalID = setInterval(RandomSound, 1000);
bgsound.setVolume(10);
}
BGSound("talk");
StartSound();
View Replies !
View Related
Help Please -Slower Fading With Setvolume
I'm trying to get a slow fad in for some music. When I put in _root.s.setVolume(vol+ 1); it fades in but much too quickly. I tried using
_root.s.setVolume(vol+ .5);
_root.s.setVolume(vol+ (0.5));
_root.s.setVolume(vol+ 0.5);
_root.s.setVolume(vol+ 1/2);
_root.s.setVolume(vol+ (1/2));
it doesn't seem to recognize my attempts at an increment anything less than 1, does anyone know what I'm doing wrong?
View Replies !
View Related
LoadMovieNum+attachSound+setVolume
Does anybody can suggested me an easy way to publish 6 different swf loaded one after the other in the flash player with 6 different song attached via A.S. ??
------------------------------------------------------------------------------
at the moment i am using
// to load ext swf :
loadMovieNum("second.swf", 1)
stop();
// they will be played all in level1
// to attach the sound:
s = new Sound(this);
s.attachSound("mySound");
s.start();
// volume setting:
vol = s.getvolume();
s.setVolume(vol - 10);
------------------------------------------
I can load the 6 swf in a row, i can make them play different songs via A.S. but as soon as i start dealing with the volume scripts to adjuste the fade out ( B4 to load the new swf) everything goes to bananas.
please ask for more if all this iz not clear enought.
View Replies !
View Related
OnSoundComplete And SetVolume Problems
Hi all.
I'm having some sound confusion.
Firstly, when I set the volume of one sound to a specific value, it appears to change the volumes of all other sounds. For example, in the below code, playing the ocean sound sets the volume of the intro sound to 10. Also, when I use onSoundComplete, it doesn't work at all.
Can anyone help?
Code:
function fPlaySound(ID){
switch(ID){
case "intro":
var sndIntro:Sound = new Sound();
sndIntro.attachSound("PBCS01");
sndIntro.setVolume(100);
sndIntro.start();
sndIntro.onSoundComplete = function(){
_root.fPlaySound("intro2");
}
break;
case "intro2":
var sndIntro2:Sound = new Sound();
sndIntro2.attachSound("PBCS01");
sndIntro2.start();
break;
case "click":
var sndIntro3:Sound = new Sound();
sndIntro3.attachSound("CLICK");
sndIntro3.start();
break;
case "ocean":
var sndIntro4:Sound = new Sound();
sndIntro4.attachSound("OCEAN");
sndIntro4.setVolume(10);
sndIntro4.start(0,999999);
break;
}
}
_root.fPlaySound("intro");
_root.fPlaySound("ocean");
View Replies !
View Related
Control Volume In AS Using SetVolume
OK. I have no trouble controlling the volume of one sound in AS,
but when I try to control the volume of a second sound, the volume control doesn't seem to work .......
So what is it I'm doing wrong?code: createEmptyMovieClip("spyhunter", 1);
spyhunter = new Sound(spyhunter);
spyhunter.setVolume(35);
spyhunter.attachSound("spyhunter");
spyhunter.start(0, 9999);
createEmptyMovieClip("car", 1);
car = new Sound(car);
car.setVolume(50);
car.attachSound("car");
car.start(0, 9999);
thanks
View Replies !
View Related
[F8] SetVolume Slider Bar Not Working
I'm having trouble trying to get a slider bar that I created to adjust the volume. What happens is, as soon as I press volControl.volButton the sound goes to nothing, and sliding it back and forth does not adjust the volume.
Can someone tell me what I'm doing wrong? Thanks in advance ...
Code:
// adjust volume
var sound:Sound = new Sound();
left = 10;
right = 60;
volControl.volButton.onPress = function () {
this.startDrag (false, left, this._y, right, this._y);
sound.setVolume (100 - ((this._x - left) * 2));
}
volControl.volButton.onRelease = function () {
this.stopDrag();
}
View Replies !
View Related
SetVolume Property On Multiple MC's
Hi There,
I'm struggling to find a simple way to control sound clips in different
MC's. Everything I set works globally.
I'm using...
var SoundOne:Sound = new Sound();
SoundOne.attachSound("One");
SoundOne.start();
SoundOne.setVolume(20);
var SoundTwo:Sound = new Sound();
SoundTwo.attachSound("Two");
SoundTwo.start();
SoundTwo.setVolume(100);
I can't find anything on the Adobe support pages. Could anybody give me some
links or advice?
Much appreciated.
View Replies !
View Related
Sounds SetVolume Override Each Other
Hi -
I have a swf that brings in multiple "child" mcs. The main (parent) timeline has a sound var on it and the children mcs have their sounds. If I set both setVolumes to 100 - no problem. But if I lower the child's sound to 20 - the parent's sound is also lowered.
What am I doing wrong here? What's the correct way to set this situation up? Ideally I'd like to declare all the sounds in the parent action layer and set all the volumes from one place - but that silenced the child sound. In one experiment, the parent sound got quieter each time I used it after using the child sound.
What is the "once and for all" way to do this?
TIA some explanation.
JL
Attach Code
// this code on the main timeline (actionscript layer) -
// this sound is triggered by btn/mcs with an onRelease. These btn/mc's onReleases also attach child mcs.
var whoosh_sound:Sound = new Sound();
whoosh_sound.attachSound('whoosh2');
whoosh_sound.setVolume(100);
// this is on the child mcs actionscript layer and is triggered when a radio btn is clicked
var radioClick:Sound = new Sound();
radioClick.attachSound('radioClickSnd');
radioClick.setVolume(10); // why does this setVolume control both sounds?
View Replies !
View Related
Audio Stream + SetVolume
Hi,
In my flash project I'm using a background-music that streams with a frame event.
Is it possible to control the volume of these streams??
Or do I have to use a soundobject? But if I use sound objects it has to be exported on the first frame, (right?), and if I do that, it will take forever to load properly,... What is the best solution?
I have to set the volume to about 20 or so, because otherwise the voice over isnt clear...
Thanks
View Replies !
View Related
|