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

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

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

for (prop in this.id3) {<br />

trace(prop+" = "+this.id3[prop]);<br />

}<br />

trace("ID3 loa<strong>de</strong>d.");<br />

};<br />

this.play_mc.onRelease = function() {<br />

/* get the current offset. if you stop all sounds and click the play<br />

button, the MP3 continues from<br />

where it was stopped, instead of restarting from the beginning. */<br />

var numSecondsOffset:Number = (bg_sound.position/1000);<br />

bg_sound.start(numSecondsOffset);<br />

};<br />

this.stop_mc.onRelease = function() {<br />

stopAllSounds();<br />

};<br />

Voir également<br />

Sound<br />

Fonction stopDrag<br />

stopDrag() : Void<br />

Arrête l'opération <strong>de</strong> déplacement en cours.<br />

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

Exemple<br />

Le co<strong>de</strong> suivant, placé dans le scénario principal, arrête le mouvement sur l'occurrence <strong>de</strong> clip<br />

my_mc lorsque l'utilisateur relâche le bouton <strong>de</strong> la souris :<br />

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

startDrag(this);<br />

}<br />

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

stopDrag();<br />

}<br />

Voir également<br />

Fonction startDrag, _droptarget (propriété MovieClip._droptarget), startDrag<br />

(métho<strong>de</strong> MovieClip.startDrag), stopDrag (métho<strong>de</strong> MovieClip.stopDrag)<br />

108 Chapitre 1: Eléments <strong>du</strong> <strong>langage</strong> <strong>ActionScript</strong>

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

Saved successfully!

Ooh no, something went wrong!