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.

_ymouse (propriété Button._ymouse)<br />

public _ymouse : Number [lecture seule]<br />

Indique la coordonnée y <strong>de</strong> la position <strong>de</strong> la souris par rapport au bouton.<br />

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

Exemple<br />

L'exemple suivant affiche la position ymouse pour la scène et un bouton intitulé my_btn placé<br />

sur celle-ci. Entrez le co<strong>de</strong> <strong>ActionScript</strong> suivant dans l'image 1 <strong>du</strong> scénario :<br />

this.createTextField("mouse_txt", 999, 5, 5, 150, 40);<br />

mouse_txt.html = true;<br />

mouse_txt.wordWrap = true;<br />

mouse_txt.bor<strong>de</strong>r = true;<br />

mouse_txt.autoSize = true;<br />

mouse_txt.selectable = false;<br />

//<br />

var mouseListener:Object = new Object();<br />

mouseListener.onMouseMove = function() {<br />

var table_str:String = "";<br />

table_str += "Stage\t"+"x:"+_xmouse+"\t"+"y:"+_ymouse+newline;<br />

table_str += "Button\t"+"x:"+my_btn._xmouse+"\t"+"y:"+my_btn._ymouse+newline;<br />

table_str += "";<br />

mouse_txt.htmlText = table_str;<br />

};<br />

Mouse.addListener(mouseListener);<br />

Voir également<br />

_xmouse (propriété Button._xmouse)<br />

_yscale (propriété Button._yscale)<br />

public _yscale : Number<br />

Le redimensionnement vertical <strong>du</strong> bouton tel qu'il est appliqué à partir <strong>du</strong> point d'alignement<br />

<strong>du</strong> bouton, exprimé en pourcentage. Le point d'alignement par défaut est (0,0).<br />

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

Exemple<br />

L'exemple suivant redimensionne un bouton intitulé my_btn. Lorsque vous cliquez sur le<br />

bouton et le relâchez, sa taille augmente <strong>de</strong> 10 % sur l'axe x et y. Entrez le co<strong>de</strong> <strong>ActionScript</strong><br />

suivant dans l'image 1 <strong>du</strong> scénario :<br />

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

Button 395

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

Saved successfully!

Ooh no, something went wrong!