03.07.2013 Views

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

knob_mc.left = knob_mc._x-(bar_width/2);<br />

knob_mc.right = knob_mc._x+(bar_width/2);<br />

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

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

knob_mc.onPress = function() {<br />

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

};<br />

knob_mc.onRelease = function() {<br />

this.stopDrag();<br />

var multiplier:Number = 100/(this.right-this.left) 2;<br />

var pan:Number = (this._x-this.left-(bar_width/2)) multiplier;<br />

my_sound.setPan(pan);<br />

pan_txt.text = my_sound.getPan();<br />

};<br />

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

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

this.createTextField("pan_txt", this.getNextHighestDepth(), knob_mc._x,<br />

knob_mc._y+knob_mc._height, 20, 22);<br />

pan_txt.selectable = false;<br />

pan_txt.autoSize = "center";<br />

pan_txt.text = my_sound.getPan();<br />

La métho<strong>de</strong> MovieClip.getNextHighestDepth() utilisée dans cet exemple requiert Flash<br />

Player 7 ou version ultérieure. Si votre fichier SWF comporte un composant <strong>de</strong> la version 2,<br />

utilisez la classe DepthManager <strong>de</strong>s composants <strong>de</strong> la version 2 au lieu <strong>de</strong> la métho<strong>de</strong><br />

MovieClip.getNextHighestDepth().<br />

Voir également<br />

setPan (métho<strong>de</strong> Sound.setPan)<br />

getTransform (métho<strong>de</strong> Sound.getTransform)<br />

public getTransform() : Object<br />

Renvoie les informations <strong>de</strong> transformation <strong>du</strong> son pour l'objet Sound spécifié défini avec le<br />

<strong>de</strong>rnier appel Sound.setTransform().<br />

Disponibilité : <strong>ActionScript</strong> 1.0 ; Flash Player 5<br />

Valeur renvoyée<br />

Object - Objet avec <strong>de</strong>s propriétés qui contiennent les valeurs <strong>de</strong> pourcentage <strong>de</strong> canaux pour<br />

l'objet Sound spécifié.<br />

Sound 1141

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

Saved successfully!

Ooh no, something went wrong!