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.

largeur (propriété Camera.width)<br />

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

La largeur <strong>de</strong> capture actuelle, en pixels. Pour définir une valeur souhaitée pour cette<br />

propriété, utilisez Camera.setMo<strong>de</strong>().<br />

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

Exemple<br />

Le co<strong>de</strong> suivant affiche la largeur, la hauteur et la valeur IPS (FPS) actuelles d'une occurrence<br />

vidéo dans une occurrence <strong>du</strong> composant Label sur la scène. Créez une nouvelle occurrence<br />

vidéo en sélectionnant Nouvelle vidéo dans le menu d'options <strong>de</strong> la bibliothèque. Ajoutez une<br />

occurrence intitulée my_vi<strong>de</strong>o à la scène. Ajoutez une occurrence <strong>du</strong> composant Label<br />

intitulée dimensions_lbl à la scène. Ajoutez ensuite le co<strong>de</strong> <strong>ActionScript</strong> suivant à l'image 1 <strong>du</strong><br />

scénario :<br />

var my_cam:Camera = Camera.get();<br />

var my_vi<strong>de</strong>o:Vi<strong>de</strong>o;<br />

my_vi<strong>de</strong>o.attachVi<strong>de</strong>o(my_cam);<br />

var dimensions_lbl:mx.controls.Label;<br />

dimensions_lbl.setStyle("fontSize", 9);<br />

dimensions_lbl.setStyle("fontWeight", "bold");<br />

dimensions_lbl.setStyle("textAlign", "center");<br />

dimensions_lbl.text = "width: "+my_cam.width+", height: "+my_cam.height+",<br />

FPS: "+my_cam.fps;<br />

Consultez aussi l'exemple relatif à Camera.setMo<strong>de</strong>().<br />

Voir également<br />

height (propriété Camera.height), setMo<strong>de</strong> (métho<strong>de</strong> Camera.setMo<strong>de</strong>)<br />

capabilities (System.capabilities)<br />

Object<br />

|<br />

+-System.capabilities<br />

public class capabilities<br />

extends Object<br />

420 Chapitre 2: Classes <strong>ActionScript</strong>

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

Saved successfully!

Ooh no, something went wrong!