EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Getvolume (Sound.getvolume Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1104 ActionScript classes
this.stopDrag();
updateTransformTxt();
}
function updateTransformTxt() {
var ll_num:Number = 30+100-knob_ll._y;
var lr_num:Number = 30+100-knob_lr._y;
var rl_num:Number = 30+100-knob_rl._y;
var rr_num:Number = 30+100-knob_rr._y;
my_sound.setTransform({ll:ll_num, lr:lr_num, rl:rl_num, rr:rr_num});
transform_mc.transform_txt.htmlText = "<textformat
tabStops='[0,30,60,90]'>";
transform_mc.transform_txt.htmlText +=
ll_num+"\t"+lr_num+"\t"+rl_num+"\t"+rr_num;
transform_mc.transform_txt.htmlText += "</textformat>";
}
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method.
See also
setTransform (Sound.setTransform method)
getVolume (Sound.getVolume method)
public getVolume() : Number
Returns the sound volume level as an integer from 0 to 100, where 0 is off and 100 is full
volume. The default setting is 100.
Availability: ActionScript 1.0; Flash Player 5
Returns
Number - An integer.
Example
The following example creates a slider using the Drawing API and a movie clip that is created
at runtime. A dynamically created text field displays the current volume level of the sound
playing in the SWF file. Add the following ActionScript to your AS or FLA file:
var my_sound:Sound = new Sound();
my_sound.loadSound("song3.mp3", true);
this.createEmptyMovieClip("knob_mc", this.getNextHighestDepth());
knob_mc.left = knob_mc._x;
knob_mc.right = knob_mc.left+100;

Table of Contents

Related product manuals