# Need to setSound at lowest possible volume to minimize intrusiveness

**URL:** https://forum.kirupa.com/t/need-to-setsound-at-lowest-possible-volume-to-minimize-intrusiveness/181873
**Category:** flash
**Created:** [March 13, 2006, 9:26pm UTC](https://forum.kirupa.com/t/need-to-setsound-at-lowest-possible-volume-to-minimize-intrusiveness/181873 "2006-03-13T21:26:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)
#### Post date: [March 13, 2006, 9:26pm UTC](https://forum.kirupa.com/t/need-to-setsound-at-lowest-possible-volume-to-minimize-intrusiveness/181873/1 "2006-03-13T21:26:37Z")

</div>

The swf I need to modify from the commonsense approach is below. Because this ad expands when a 120x90 “trigger” is rolled over the client has asked for the ad to start on rollover which I have accomplished with a button on frame 1 with a on (rollover) {  
gotoAndPlay(2);  
}

Because people will accidentally rollover this ad and start it playing the client wants the ad to start at a 0 volume level. This way the accidental rollovers can still choose to turn up the volume to hear the commercial if they so choose.

I have tried changing the sound level in the AS in a couple places but neither worked. In addition intuitively the slider also needs to be in the 0 position and I have a feeling just moving the graphic instance of the volume button is not the way to go.

[http://www.cincinnati.com/sponsors/basementliving/ad\_basementLiving\_rollover\_300x250.html](http://www.cincinnati.com/sponsors/basementliving/ad_basementLiving_rollover_300x250.html)

actionscript for volume control is:

onClipEvent (load) {  
\_root.volumeLevel = 100;  
left = \_x-50;  
right = \_x;  
top = \_y;  
bottom = \_y;  
}  
onClipEvent (enterFrame) {  
if (dragging) {  
\_root.volumeAmount = ((\_x-left)\*2);  
\_root.volumeLevel = Math.round(\_root.volumeAmount);  
\_root.mySound.setVolume ((\_x-left)\*2);  
if (\_root.volumeLevel \> 1){  
\_root.offonText = “sound on”;  
}  
else if (\_root.volumeLevel \< 1){  
\_root.offonText = “sound off”;  
}  
}

}

actionscript for movie is:

framerate = 25;// change the framerate to match the video  
// volume controls  
mySound = new Sound();  
mySound.attachSound("");  
mySoundsetVolume(0);  
mySound.start(0, 999);  
//  
this.pausebutton.\_visible = 0;  
this.playbutton.\_visible = 1;  
timing = true;  
milli = 99;  
//  
playbutton.onRelease=function() {  
unpause();  
pausebutton.\_visible = 1;  
playbutton.\_visible = 0;  
};  
//  
pausebutton.onRelease=function() {  
pause();  
playbutton.\_visible = 1;  
pausebutton.\_visible = 0;  
};  
// timer script – total frames divided by the frame rate  
\_root.onEnterFrame = function() {  
howmanyframes = \_totalframes;  
whichframe = \_currentframe;  
totalTime = getTimer()/1000-pauseLength;  
goTime = totalTime-buttonPressTime;  
//  
if (timing) {  
mins = Math.floor((howmanyframes-whichframe)/(framerate_60));  
secs = Math.floor(((howmanyframes-whichframe)/framerate)-(mins_60));  
milli = Math.round(milli) - 1;  
if (secs\<10) {  
secs = “0”+secs;  
}  
if (mins\<10) {  
mins = “0”+mins;  
}  
if (milli\<10) {  
milli = “0”+milli;  
}  
if (milli == 00) {  
milli = 99;  
}  
}  
};  
//  
function restartTimer() {  
mins = “–”;  
secs = “–”;  
milli = “–”;  
buttonPressTime = getTimer()/1000-pauseLength;  
pause();  
};  
//  
function pause() {  
pauseTime = getTimer()/1000;  
timing = false;  
this.stop();  
};  
//  
function unpause() {  
unpauseTime = getTimer()/1000;  
pauseLength = (unpauseTime-pauseTime)+pauseLength;  
timing = true;  
this.play();  
};  
//  
stop();
