03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

this.startDrag(false, this.left, this.top, this.right, this.bottom);<br />

}<br />

function releaseKnob() {<br />

this.stopDrag();<br />

updateTransformTxt();<br />

}<br />

function updateTransformTxt() {<br />

var ll_num:Number = 30+100-knob_ll._y;<br />

var lr_num:Number = 30+100-knob_lr._y;<br />

var rl_num:Number = 30+100-knob_rl._y;<br />

var rr_num:Number = 30+100-knob_rr._y;<br />

my_sound.setTransform({ll:ll_num, lr:lr_num, rl:rl_num, rr:rr_num});<br />

transform_mc.transform_txt.htmlText = "";<br />

transform_mc.transform_txt.htmlText +=<br />

ll_num+"\t"+lr_num+"\t"+rl_num+"\t"+rr_num;<br />

transform_mc.transform_txt.htmlText += "";<br />

}<br />

See also<br />

setTransform (Sound.setTransform method)<br />

getVolume (Sound.getVolume method)<br />

public getVolume() : Number<br />

Returns the sound volume level as an integer from 0 to 100, where 0 is off <strong>and</strong> 100 is full<br />

volume. The default setting is 100.<br />

Returns<br />

Number - An integer.<br />

Example<br />

The following example creates a slider using the Drawing API <strong>and</strong> a movie clip that is created<br />

at runtime. A dynamically created text field displays the current volume level of the sound<br />

playing in the SWF file. Add the following ActionScript to your ActionScript or FLA file:<br />

var my_sound:Sound = new Sound();<br />

my_sound.loadSound("song3.mp3", true);<br />

this.createEmptyMovieClip("knob_mc", this.getNextHighestDepth());<br />

knob_mc.left = knob_mc._x;<br />

knob_mc.right = knob_mc.left+100;<br />

knob_mc.top = knob_mc._y;<br />

knob_mc.bottom = knob_mc._y;<br />

572 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!