MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 757

Actionscript language reference
Table of Contents

Advertisement

knob_mc.left = knob_mc._x-(bar_width/2);
knob_mc.right = knob_mc._x+(bar_width/2);
knob_mc.top = knob_mc._y;
knob_mc.bottom = knob_mc._y;
knob_mc.onPress = function() {
this.startDrag(false, this.left, this.top, this.right, this.bottom);
};
knob_mc.onRelease = function() {
this.stopDrag();
var multiplier:Number = 100/(this.right-this.left)*2;
var pan:Number = (this._x-this.left-(bar_width/2))*multiplier;
my_sound.setPan(pan);
pan_txt.text = my_sound.getPan();
};
var my_sound:Sound = new Sound();
my_sound.loadSound("song2.mp3", true);
this.createTextField("pan_txt", this.getNextHighestDepth(), knob_mc._x,
knob_mc._y+knob_mc._height, 20, 22);
pan_txt.selectable = false;
pan_txt.autoSize = "center";
pan_txt.text = my_sound.getPan();
See also
Sound.setPan()
Sound.getPan()
757

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents