Volume Buttons Change Volume More Than Once Per Click
I am going to try to explain this as best I can without posting the code for all 4 classes and the timeline.
Information:
I have a class that controls the playing of the sound, it also is hooked up to my volume up and down buttons. I have a class for a button that moves the frame forwards and another that moves the frame backwards. On the timeline I have a layer for sound, where I import the class that does the sound as well as instantiates it and add the child (which is a sound file). The class that plays the sound file also automatically goes to the next frame when the sound is done. Relevant code will be posted after explanation of problem.
Problem:
When the next or back buttons are clicked, flash moves to the next or previous frame, which then does addChild and instantiates the class for sound again. I do have each frame set to SoundMixer.stopAll(); which does stop the sound but it doesn't prevent multiple instances of the class or child being active. So what happens then is that if I hit the next button 5 times, then click the sound up button, the sound goes up 6 times! at once.
Relevant Code:
relevant portions of class that controls sound:
Code:
public static var trans:SoundTransform = new SoundTransform();
Code:
private function soundUp(event:MouseEvent)
{
SoundMain.trans.volume += .2;
trace(SoundMain.trans.volume);
soundChannel.soundTransform = SoundMain.trans;
}
relevant portions of timeline code (on each frame):
Code:
import flash.media.SoundMixer;
SoundMixer.stopAll();
import lesson.SoundMain;
var sndEx2:SoundMain = new SoundMain("micRec2.mp3");
addChild(sndEx2);
partial code in next button class:
Code:
private function oneFrameForward(evt:MouseEvent):void
{
MovieClip(parent).nextFrame();
}
I appreciate any help.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 12-05-2007, 05:55 PM
View Complete Forum Thread with Replies
Sponsored Links:
How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:
onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}
onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}
//_root.maxvolume+=step;
if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}
_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}
I then setup a slider bar to adjust the volume:
onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}
Then I set the volume based on the dragging of the slider bar:
on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.
View Replies !
View Related
How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:
onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}
onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}
//_root.maxvolume+=step;
if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}
_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}
I then setup a slider bar to adjust the volume:
onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}
Then I set the volume based on the dragging of the slider bar:
on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.
View Replies !
View Related
Flash 8 FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.
I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.
Is this possible? If so, how would this be done?
Thanks!
James
jamesk@pacificmm.com
View Replies !
View Related
[F8] FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.
I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.
Is this possible? If so, how would this be done?
Thanks!
James
jamesk@pacificmm.com
View Replies !
View Related
Volume Slider Tutorial (changing The Start Volume)
Hi,
This is my first post, also my first problem. Not going so well so far! Okay, i downloaded the tutorial and read through it. Maybe not so well, since i'm a little stuck.
I wanted to modify the slider, so rather than starting off as silent, it starts off so the sound can be heard. So i edited the slider and moved the indicator further along. However, the mp3 cannot be heard until the silder indicator is moved.
i tried modifying the play button to this;
ActionScript Code:
on (release) { if (_root.mySlider.complete == 1) { _root.mySlider.mySound.stop(); mySound.setVolume(_root.volume(ratio)); _root.mySlider.mySound.start(0, 99); }}
but it still doesn't seem to work. Also the 'circles' don't automatically take the height. As soon as I move the slider, the circles 'jump' to the correct size and the volume plays properly.
Also i'd kind of like the song to start playing as soon as its loaded. Okay, i know that i could maybe download something that does all of this already, but i'd rather (or more likely be shown how to) modify the tutorial since i'm a beginner.
Apologies, i'm new to all this. I know some oop, but actionscript and all these properties are a bit new to me.
Thanks in advance,
View Replies !
View Related
How Do I Change The Volume Of An Mp3
I know it has something to do with soundTransform, but I've been trying to get it working for a few hours now and no luck. Here is my code to start the song. If you cant tell by byte array I am making a spectrum analyzer.
EDIT: I actually have another question. I have two of the same movie clips, playing 2 different songs and what I thought would happen is they would each have their own spectrum, but turns out they sharing the same sound channel. I tried changing each names of the sound channel but didnt work. Here is my code for clip 1:
ActionScript Code:
//BALL1var 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);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); }}
and clip2:
ActionScript Code:
//ball2var s2:Sound = new Sound();var sc2:SoundChannel;var ba2:ByteArray = new ByteArray();var array:Array;s2.load(new URLRequest("mix.mp3"));sc2 = s2.play(0,1000);this.addEventListener(Event.ENTER_FRAME, spectrum);var a:Number = 0;function spectrum(event:Event) { a = 0; graphics.clear(); SoundMixer.computeSpectrum(ba2,true,0); for (var i=0; i < 256; i=i+8) { a = ba2.readFloat(); var num:Number = a*360; graphics.lineStyle(num/15,0x00ccff|(num << 8),5); graphics.drawCircle(0,0,i); }}
you can see what im talking about at
http://ostari.com/ronnie/spectrum/leespec.swf
thanks a lot!
View Replies !
View Related
How To Change The Sound Volume?
Hi,
I've been searching all over the internet and this forum for an answer on how to change the volume of a sound object in AS3.
All posts on this forum seem to be for AS2 and not AS3.
I have imported a .wav file into my library and have got the sound playing by targeting the class name I entered via the "Export for ActionScript" section within the .wav's Linkage.
I gave the name "sMain" and my code is as follows....
Code:
// PLAY BACKGROUND MUSIC
var soundBg:Sound = new sMain();
soundBg.play(0,100); // repeat sound 100 times
But I can't work out how to change the volume so it's not playing at 100% (I need it playing at 70%).
I've tried the following with no luck....
Code:
// PLAY BACKGROUND MUSIC
var soundBg:Sound = new sMain();
soundBg.play(0,100); // repeat sound 100 times
// SET THE VOLUME
var myVol:SoundTransform = new SoundTransform();
myVol.volume = 0.5;
soundBg.soundTransform = myVol;
Any help would be greatly appreciated!
Kind regards,
Mark
View Replies !
View Related
Change Volume Of A Quicktime In Flash
Hello,
I'm embedding a quicktime movie in to flash. Playing as a webcast. Got all my movie controls working play, stop, ffw, rew. But, can't work out how to change the volume. The sound is in the quicktime movie and not a separate sound file. Is it possible to adjust the volume of an embedded quicktime movie?
Cheers,
Craig
View Replies !
View Related
Urgent How To Change Volume Of Sound?
Hello everybody
I really urgently need to find a way to adjust the volume of an MP3 file that has been imported to the library.
I have two layers - Narration and Sound. The Narration layer is fine, but the volume of the Sound.mp3 file (on the Sound layer) renders Narration.mp3 inaudible. I've adjusted the linkage properties of the Sound.mp3 file so that it Exports with ActionScript, and assigned the name as musicsound.
Is there a simple actionscript I can place on the first frame of the main layer (not within a movie clip or other kind of symbol)? The difficulty I face is that I've tried the following methods, to no avail:
musicsound = new Sound();
musicsound.attachSound("Sound.mp3");
musicsound.setVolume(50);
musicsound.start();
along with
function playSound(soundName){
musicsound = new Sound();
musicsound.attachSound(soundName);
musicsound.setVolume(50);
musicsound.start();
}
playSound("Sound.mp3")
...but I wasn't entirely sure where it would work.
I also tried creating a movie clip with the above codes within it, along with an onClipEvent() function, but that didn't work either.
Also, do imported MP3 files with filenames such as:
Sound - music24.mp3
...affect the code used?
I'm sure there must be a simple way to do this. Any suggestions? All help much appreciated.
- Grace Adair
View Replies !
View Related
Drag MC And Volume - How To Translate Into Volume 0-100?
Hey there
I am building a room in which you can drag a MC in order to controll pan and volume. I am using:
function drag() {
kasse1Pan.kasse1.startDrag(false, -400, -300, 400, 300);
kasse1Pan.kasse1.onEnterFrame = function() {
pan = 0.25*this._x;
vol = 300+this._y;
kasse1Sound.setPan(pan);
kasse1Sound.setVolume(vol);
};
The problem is that the stage is 800 x 600, and therefore -300 is translated to zero (when the MC is at the top of the stage) and 300 is translated to 600 (when the MC is at the bottom of the stage). Naturally, this causes the volume to distort.
I need find a way to translate the -300 and 300 to 0 and 100% volume.
Can you help? Oh, I hope so...
/Donleavy
View Replies !
View Related
Volume - Setting Initial Volume
In addition to code help with setting the initial volume, can anyone tell me why the slider might be staying at the end of the bar once I'm off dragging it.. It doesn't move back to the start of the slider when I drag to increase volume the first time...
This is where the fla file is in case anyone wishes to help me with the latter question...
http://www.clairmonthumphrey.com/Site/humphreytemplate.fla
Thanks so much!
Attach Code
//volume slider
dragger.onPress = function()
{
this.startDrag(true, dragger._x, dragger._y, dragger._x + 95, dragger._y);
};
dragger.onRelease = dragger.onReleaseOutside=function ()
{
stopDrag();
};
dragger.onMouseMove = function()
{
newPoint = new Object();
newPoint.x = this._x
newPoint.y = this._y
_root.slidebar.globalToLocal(newPoint);
_root.s.setVolume(-1*newPoint.x);
}
View Replies !
View Related
Volume Slider Bar Innital Volume
I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i'm doing, but i'd like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I'm sure this is a simple line of code that i'm overlooking, any help would be appreciated.
Thanks!
scott.dixon@itron.com
View Replies !
View Related
Volume Slider Bar Innital Volume
I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i'm doing, but i'd like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I'm sure this is a simple line of code that i'm overlooking, any help would be appreciated.
Thanks!
scott.dixon@itron.com
View Replies !
View Related
Increment Volume When A Movie Clip Button Is Click And Hold
///////////////////////////////////////////////////////////////////////////////////
clip.onPress = function(){
if (_root.mySound.getVolume () < 100)
{
_root.mySound.setVolume (_root.mySound.getVolume () + 10);
}
}
//////////////////////////////////////////////////////////////////////////////////
Hi I found this code on your tutorials, it works but my problem is that the Movie Clip button has to be click again and again just to increase the volume of mySound.
Is there a way so that when I click the Movie Clip button and hold the mouse, the volume of mySound would increment without clicking it again?
I really need help, i'm new with actionscripting.
Thanks in Advance
View Replies !
View Related
How To Change The Volume Of MediaPlayBack Component... Urgent Please HelpHELP
How do you decrease the default volume of the MediaPlayback component or change it?
This is urgent. Please help me.... I will greatly appreciate it....
I am trying to lower the default volume of a MediaPlayback component in Flash 8 but I am unable to do so. Also, could you please tell me some way in which I could decrease the volume of the MediaPlayback component through actionscript... for example, in the actions part of a frame, you write::
onEnterFrame {
playback.----(((((something?????))))------
please tell me.
Thanks in advance,
Animesh
View Replies !
View Related
Problem...Urgent. How To Change The Volume Of The MediaPlayback Component Through Actionscript Or Otherwise
How do you decrease the default volume of the MediaPlayback component or change it?
This is urgent. Please help me.... I will greatly appreciate it....
I am trying to lower the default volume of a MediaPlayback component in Flash 8 but I am unable to do so. Also, could you please tell me some way in which I could decrease the volume of the MediaPlayback component through actionscript... for example, in the actions part of a frame, you write::
onEnterFrame {
playback.----(((((something?????))))------
please tell me.
Thanks in advance,
Animesh
View Replies !
View Related
Volume Buttons
Hi
I have a MClip which has 6 buttons in it, each button needs to set the volume
button 1 = 0
button 2 = 20
button 3 = 40
button 4 = 60
button 5 = 80
button 6 = 100
hope this makes sence, all im after is some code to achive this.
Thx
View Replies !
View Related
[CS3] AS2 Volume Buttons
I have two buttons that i want to use to change the volume of music up or down by a set amount.
The actionscript for the music is
sound=new Sound();
sound.loadSound("mymusic.mp3");
in the actions layer then
on(release){
sound.start(cue);
}
for the play button
can anyone tell me the AS to put on the up and down buttons
cheers
View Replies !
View Related
Volume Buttons.
I am trying to create some volume buttons. There will be 5 and for example if the mouse is on the 4th one, all 3 below will also be open, or if the mouse is over 2nd light, the 1st light will also be open. How can I manage this? I have some idea but dont know exactly how to achieve it.
View Replies !
View Related
Volume Buttons.
I am trying to create some volume buttons. There will be 5 and for example if the mouse is on the 4th one, all 3 below will also be open, or if the mouse is over 2nd light, the 1st light will also be open. How can I manage this? I have some idea but dont know exactly how to achieve it.
View Replies !
View Related
Sound Volume And Next/Pre Buttons
Hi I have this code to control the sound volume.
volume = new Sound();
volume.attachSound("test");
volume.start(0,999999);
stop();
I want to add 5 more sound to this. I will allow the user to choice the sound they want to play and i will have next/pre buttons to control the selection. How would i connect them all together. Whenever the user choices the the sound it will be controlled by the volume control buttons. How would i do this.
View Replies !
View Related
Why Is My Volume Fader And Buttons Not Working?
I have external loops that are loaded into an MC called loopholder (created using AS). I have a fader that is linked to a variable called vol. When I trace(vol) it gives me the figures that I am looking for. The problem seems to be with the command to set the volume. Here's the code:
Code:
//volume slider link to loop volume
vol=((_root.controls.slider._y * -2) + 170);
_root.loopholder.setVolume(vol);
It is inside an onEnterFrame function.
Also, my stop and start buttons for the sound don't seem to work either. They are MC instances that fade between each other.
Here's the code for them:
Code:
//soundtrack buttons and events
_root.stbuttons.playstop.ststart._visible = false;
_root.stbuttons.playstop.ststop.onRelease = function(){
_root.loopholder.stop();
_root.stbuttons.playstop.onEnterFrame = function(){
if(_root.stbuttons.playstop.ststop._alpha > 0){
_root.stbuttons.playstop.ststop._alpha -=5;
_root.stbuttons.playstop.ststart._alpha +=5;
};
_root.stbuttons.playstop.ststop._visible = false;
_root.stbuttons.playstop.ststart._visible = true;
};
the start and stop buttons are labelled ststop and ststart. They are inside a holder called playstop, which is inside another holder called stbuttons. I have put a trace("stopped") command after the onRelease function to check that it is registering the click of the mouse and it works fine. Again, I think it has to be something to do with the _root.loopholder.stop(); command, but I don't see what can be wrong with it.
Has anyone any idea why neither of these seem to work?
Thanks for your help
Graeme
View Replies !
View Related
Help Adding A Volume Control To Buttons
I've been looking around and searching to see how I can add a volume slider that controls the sound of the buttons on my site. They only make noise when you roll over them or click on them and I want the user to have to choice to turn off the sound or turn down the sound if they want to. I followed the "Creating a Volume Control Slider" tutorial http://www.kirupa.com/developer/mx/volume_slider.htm and I can't get it to coorespond with the sounds of my buttons. Is this even possible? I'm pretty new to flash so any help I can get would be great!
View Replies !
View Related
Changing The Same Sound's Volume On Multiple Buttons...
Hi,
I'm using the same sound for the "Over" state on a set of multiple buttons; is there a way to adjust the level of this sound globally without having to go in and change the envelope for each instance? -- I'd like the same adjusted level for all the buttons in the set.
The sounds are assigned directly to the button state frames. Is there a way to do this with sound objects? I'm new to Flash and I don't fully understand sound objects yet, even though I've read about them.
Thanks,
Todd Lerner
View Replies !
View Related
Is It Possible To Change The Sound Volume On Individual Attached Sound Clips?
For instance, I have 2 attached sound samples, both playing continuously. I want to be able to control the volume for both separately.
All I know I can use is setVolume, but that one seems to be global only and changes the volume on both.
I tried having different names on the attached sounds (sound1, sound2) and had the volume buttons refer to sound1.setVolume and sound2.setVolume, but each of them controlled both sounds. Also tried attaching the sounds into individual MCs, but got the same result .
So, can this be done?
Edit: oh, there was a forum for sound and music, my bad. Can seem to find how to delete this thread so have to leave it here or if some mod moves it.
Edit2: Ok, think I got it to work, was trying this method before posting (from FAQ), but couldn't get it to work... might have now... buggy it seems.
Quote:
Why is my sound object controlling volume or pan of all sounds in the movie?
a sound object without an associated mc is a "global" sound object and controls volume and pan of all loaded sounds.
to ensure that a sound object controls just one sound pass the target path of a unique movie clip to the sound function.
myuniquesound = new Sound(target path to unique mc);
OR
// dynamically create a mc and associate it with a sound object
soundobject = new Sound(createEmptyMovieClip("snd",getNextHighestDep th()));
Edit3: Problem solved .
View Replies !
View Related
Mp3 Player Volume Vs Video Player Volume
Hello people!!!
I'm having some trouble on getting a video player to play its sound...
when the movie player is loaded, I tell the mp3 player (that starts playing when the site is loaded) to reduce the volume to 0... but this way, when the movie starts there is no sound because of the mp3 player!
How can I have to different volume bars?!
Please help!
(sorry about the english...portuguese guy)
View Replies !
View Related
Buttons That Change On Click
i am pretty new to flash and am tring to makes buttons that work like the ones on optic nrg. http://www.opticnrg.com/v2/index2.html
i want the to stay on the rollover mode after being clicked. any help will be appreciated.
View Replies !
View Related
BUTTONS THAT CHANGE COLOR ON A CLICK?
i've made quite a few buttons, but cant seem to figure out how some people make buttons that change colors... ...you see them alot on the sites where people have a bunch of buttons that look the same.....
how do u make the buttons change colors...
http://www.superlooper.de/ does it on the right side...
how do u make buttons change colors...
thanks in advance!!!!
mannyme80
View Replies !
View Related
Buttons Change Tint After Click
Hello again!! I have a couple of buttons that load external jpgs to a movie clip. Is it possible that after i click a button, the tint of that button change so that people know they already been there?
other option, is that after clicking button 1 the tint changes from x to y and if you click button 2 the tint in button 1 goes back to x, and the tint in button 2 now is y...
hope that i made myself clear... its the best way i can explain my problem...
thanks everybody!!!
View Replies !
View Related
Buttons Change Tint After Click
Hello again!! I have a couple of buttons that load external jpgs to a movie clip. Is it possible that after i click a button, the tint of that button change so that people know they already been there?
other option, is that after clicking button 1 the tint changes from x to y and if you click button 2 the tint in button 1 goes back to x, and the tint in button 2 now is y...
hope that i made myself clear... its the best way i can explain my problem...
thanks everybody!!!
View Replies !
View Related
Set Volume Bug
Ok, I play 2 sounds with this in one keyframe:
m1 = new Sound("/music");
m1.attachSound("music1");
m1.start(0, 999);
//
m2 = new Sound("/music");
m2.attachSound("music2");
m2.start(0, 999);
View Replies !
View Related
IF Volume = 0 ?
Hi,
I have a background music ( mySound) and i have a mute button as well (_root.mySound.setvolume(0)). I have some other buttons that i want to give them this assignment: to check and see if the sound is off (meaning _root.mySound.setvolume(0)and if it is already ON leave it alone. I know it need to be something like:
if soundvolume = 0 do this and if soundvolume = 100 do nothing.
help? how to put this in code
View Replies !
View Related
Volume
Is there a way to control or set the volume of a loaded movie from within the main timline of the movie it's being loaded into?
View Replies !
View Related
Volume?
ok, i have the actionscript for this site to have the volume fade in and then fade out when the audio button is clicked. my question is say i want to click on a link to a web site, i would like for the audio to fade out, but when the person comes back into my site, i want the audio to fade back in without having to actually click on the play button on the audio button, im not sure what i have to do. here is the script i have right now to make the audio fade in and out........
// load audio mp3
function primeSound() {
mySound = new Sound ();
mySound.loadSound("http://www.xscapeproductions.com/dope/system.mp3", true);
}
primeSound();
music = new Sound();
music.start(0, 999999);
// set the volume of the sound to zero
music.setVolume(0);
// set a variable named 'vol'
vol = 0;
// set another variable named 'fade', putting a setInterval function in it
fade = setInterval(fadeIn, 100);
// set the initial fade in function
function fadeIn() {
// fade the sound in with an increment of 3 in the variable 'vol'
vol += 3;
music.setVolume(vol);
// put an if condition to restrict the increment in volume after it reaches to 100
if (vol>=100) {
clearInterval(fade);
// create the 'step' variable
step = 1;
// create the 'fade' variable
Fade = 0;
}
}
// create the fade in and out function
// function executed on onEnterFrame
_root.onEnterFrame = function() {
// set fade out
if (Fade == 1) {
vol = vol-step;
if (vol<0) {
vol = 0;
}
music.setVolume(vol);
// set fade in
} else {
vol = vol+step;
if (vol>100) {
vol = 100;
}
music.setVolume(vol);
}
};
and here is what is on the main audio buttons :.....
on (release) {
(_root.fade=!_root.fade) ? 0 : 1;
}
thanx in advance
sean
View Replies !
View Related
Volume
Why oh why when i try and change the volume of on clip does it change the volume of all the clips.
This is the code i am using
mySound = new Sound();
mySound.attachSound("whatever");
mySound.start(0,100);
mySound2 = new Sound();
mySound2.attachSound("trevor");
mySound2.start(0,100);
mySound.setVolume(0);
mySound2.setVolume(0);
Please help its really buggin me . All the books seem to say that this should work
:[
View Replies !
View Related
Volume Of An MC
I have a mc loaded into my main movie file, and I want to place a volume controller on the main clip that will control the volume of the loaded mc. how would i go about doing this?
Thanks.
PS: I cannot use the attachSound method.
View Replies !
View Related
What's With The Volume?
ok, I figured out that compression of a sound clip plays a part wih volume once its in the library. But, what I've noticed is that with compression options the best sounding version of the clip is with the "raw" setting, but that's only at 50%. Is there a setting so it can be at 100%; to be as true-to-the-origional?
thanks
View Replies !
View Related
Set Volume
I need a mute button!
Sound files (7) are on the main timeline every five frames and loop (stop all sounds wont work).
one way i thought was to have a mute button that sets a volume value.
what would be the best way to action, set volume? much thanks! Paul
View Replies !
View Related
Set Volume
I need to turn volume on/off
Can I use a button action to set volume.
this.onButton_btn.onRelease = function(){
Im new to actionscripting so need some good data, thanks Paul
View Replies !
View Related
Volume
I know its probably a noob question, but i started 3 days ago on 2.0 then yesterday made an mp3 player in 3.0 but i cant figure out how to set the volume, i have the math to make it a number between 0 and 1 but i dont know how to actually set the volume. Any Suggestions?
View Replies !
View Related
Help With Volume
I have inherited this code. I would like to mute the volume when playing this swf. But I tried the <param name="volume" value="0" /> and <param name="mute" value="true" /> and they did not work. Please help! The code is below:
<noscript>
<object id="FlashIntro" classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="645" height="245" bgcolor="#FFFFFF" VIEWASTEXT>
<param name="movie" value="Flash/homeFlash.swf" />
<param name="quality" value="high" />
<embed src="Flash/homeFlash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="645" height="245" bgcolor="#FFFFFF" />
</object>
</noscript><script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '645',
'height', '245',
'src', 'Flash/homeFlash',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'FlashIntro',
'bgcolor', '#000000',
'name', 'Flash/knee3d',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'Flash/homeFlash',
'salign', ''
); //end AC code
}
</script>
View Replies !
View Related
FLV Volume
No response in the Dreamweaver forum - so I am trying here.
When I insert a Flash video (FLV) from the Dreamweaver insert bar, the
Flash player appears on the page with the volume slider in the center
and the volume at a certain volume. How can I change the default volume
and slider position?
I've tried modifying the FLASHVARS string (in 3 separate places in the
DW code) to no avail.
--
Alec Fehl, MCSE, A+, ACE, ACI
Adobe Community Expert
AUTHOR:
Microsoft Office 2007 PowerPoint: Comprehensive Course (Labyrinth
Publications)
Welcome to Web Design and HTML (Labyrinth Publications)
CO-AUTHOR:
Microsoft Office 2007: Essentials (Labyrinth Publications)
Computer Concepts and Vista (Labyrinth Publications)
Mike Meyers' A+ Guide to Managing and Troubleshooting PCs (McGraw-Hill)
Internet Systems and Applications (EMC Paradigm)
View Replies !
View Related
Volume And Pan
So i am working on a widget and I cant seem to get the volume and balance sliders to work right. Can someone take a look at my code and see if you know what going wrong. The web address of the widget is www.buttonbeats.com/sequence.html . The only slider that works is the first one for now. Till i figure out why this one wont work. and the action script is below.
Attach Code
var myvolumebounds:Rectangle=new Rectangle(volumegroove_mc.x, volumegroove_mc.y, 1, volumegroove_mc.height);
var mybalancebounds:Rectangle=new Rectangle(balancegroove_mc.x, balancegroove_mc.y, balancegroove_mc.width, 1);
volume_mc.addEventListener(MouseEvent.MOUSE_DOWN, startdragvolume);
volume_mc.addEventListener(MouseEvent.MOUSE_OUT, stopdrag);
volume_mc.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
balance_mc.addEventListener(MouseEvent.MOUSE_DOWN, startdragbalance);
balance_mc.addEventListener(MouseEvent.MOUSE_OUT, stopdrag);
balance_mc.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
function startdragvolume(myevent:MouseEvent):void{
myevent.target.startDrag(false, myvolumebounds);
}
function startdragbalance(myevent:MouseEvent):void{
myevent.target.startDrag(false, mybalancebounds);
}
function stopdrag(myevent:MouseEvent):void{
myevent.target.stopDrag();
}
var myRequest:URLRequest=new URLRequest ("inst.mp3");
var mySound:Sound = new Sound();
var myChannel:SoundChannel;
var newSetting:SoundTransform = new SoundTransform();
mySound.load(myRequest);
myChannel=mySound.play();
stage.addEventListener(Event.ENTER_FRAME, everyframe);
function everyframe(myevent:Event):void{
var newvolume:Number = (volume_mc.y-volumegroove_mc.y)/100;
var newbalance:Number = ((balance_mc.x-balancegroove_mc.x)/50)-1;
newSetting.volume=newvolume;
newSetting.pan=newbalance;
myChannel.soundTransform=newSetting;
}
stage.addEventListener(Event.ENTER_FRAME, everyframe2);
function everyframe2(event:Event):void {
leftbar.scaleY=(myChannel.leftPeak);
rightbar.scaleY=(myChannel.rightPeak);
}
View Replies !
View Related
Volume
Volume.
Hey everone i want a sliding button thing.
So that when i bring it to the top volume=100 and when down to the bottom it =0
Do you get me.
I know there got to be examples on this or you can help nice and easy
View Replies !
View Related
Volume Changes
I'm wondering how you change the volume of a sound object that is placed on the timeline in your movie. For example if I want to control the Voice over for a loaded SWF which has the audio within the timeline (i.e. not using the Sound object) from the root of my presentation. Any help on this?
View Replies !
View Related
|