PDA

View Full Version : FMX: boosting volume above 100



PortalMelt
February 20th, 2003, 01:34 PM
I know how to make a slider that controls the volume from 100 to 0. But is there a way to boost the volume in Flash?

I want the movie to open with the volume slider at 50% (visually) but the volume level (audibly) to be 100%. Then lowering the slider to 0% will cut the audible volume to 0 but raising the slider to 100% will boost the volume audible to 200%.

Thanks for your input,
Jeff

[Legoman]
February 20th, 2003, 02:10 PM
why would you want to do that?

PortalMelt
February 20th, 2003, 02:15 PM
Reply to "Why I want to do this?"

If the volume on their computer isn't set high enough to understand the audio content then the user can't increase the volume from within the movie.

This of course assumes they have no volume sontrol on the face of their speakers (which is common). They would have to go outside the movie into 'volume control' in the OS to raise the volume one their speakers and then go back to the movie.

I hope this clarifies. Any ideas?

senocular
February 20th, 2003, 02:29 PM
you can boost the audio in the soundfile itself, but the audio in flash is only functional within the range of 0-100.

nathan99
March 28th, 2005, 04:14 AM
var my_sound:Sound = new Sound();
my_sound.loadSound("song", true);

this.createEmptyMovieClip("knob_mc", this.getNextHighestDepth(),0,0,140,64);

knob_mc.left = knob_mc._x;
knob_mc.right = knob_mc.left+200;
knob_mc.top = knob_mc._y;
knob_mc.bottom = knob_mc._y;

knob_mc._x = my_sound.getVolume();

with (knob_mc) {
lineStyle(0, 0x000000);
beginFill(0xFF0000);
moveTo(0, 0);
lineTo(4, 0);
lineTo(4, 18);
lineTo(0, 18);
lineTo(0, 0);
endFill();
}
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFFFFFF;
my_fmt.bold = true;
my_fmt.font = "Kristen ITC";
my_fmt.size = 20;


knob_mc.createTextField("volume_txt", knob_mc.getNextHighestDepth(), knob_mc._width+4, 0, 40, 30);
knob_mc.volume_txt.text = my_sound.getVolume();
knob_mc.volume_txt.setTextFormat(my_fmt);

knob_mc.onPress = function() {
this.startDrag(false, this.left, this.top, this.right, this.bottom);
this.isDragging = true;
};
knob_mc.onMouseMove = function() {
if (this.isDragging) {
this.volume_txt.text = this._x;
knob_mc.volume_txt.setTextFormat(my_fmt);

}
}
knob_mc.onRelease = function() {
this.stopDrag();
this.isDragging = false;
my_sound.setVolume(this._x);

};


A slider that sets the maximum volume to 200%

jimhere
March 28th, 2005, 09:35 AM
Is this like Spinal Tap's amplifier going to 11?

senocular
March 28th, 2005, 09:37 AM
but it goes to 11!