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.

Voir également<br />

Fonction stop<br />

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

public stopDrag() : Void<br />

Termine une métho<strong>de</strong> MovieClip.startDrag(). Un clip déplaçable via cette métho<strong>de</strong> reste<br />

déplaçable jusqu'à ce qu'une métho<strong>de</strong> stopDrag() soit ajoutée, ou jusqu'à ce qu'un autre clip<br />

<strong>de</strong>vienne déplaçable. Vous ne pouvez déplacer qu'un seul clip à la fois.<br />

Vous pouvez étendre les métho<strong>de</strong>s et les gestionnaires d'événements <strong>de</strong> la classe MovieClip en<br />

créant une sous-classe.<br />

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

Exemple<br />

L'exemple suivant crée une occurrence déplaçable <strong>de</strong> clip appelée mc_1:<br />

this.createEmptyMovieClip("mc_1", 1);<br />

with (mc_1) {<br />

lineStyle(1, 0xCCCCCC);<br />

beginFill(0x4827CF);<br />

moveTo(0, 0);<br />

lineTo(80, 0);<br />

lineTo(80, 60);<br />

lineTo(0, 60);<br />

lineTo(0, 0);<br />

endFill();<br />

}<br />

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

this.startDrag();<br />

};<br />

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

this.stopDrag();<br />

};<br />

Voir également<br />

_droptarget (propriété MovieClip._droptarget), startDrag (métho<strong>de</strong><br />

MovieClip.startDrag), Fonction stopDrag<br />

MovieClip 963

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

Saved successfully!

Ooh no, something went wrong!