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.

my_cam.onActivity = function(isActive:Boolean) {<br />

var themeColor:String = (isActive) ? "haloGreen" : "haloOrange";<br />

activity_pb.setStyle("themeColor", themeColor);<br />

};<br />

Voir également<br />

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

Camera.setMotionLevel )<br />

bandwidth (propriété Camera.bandwidth)<br />

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

Un entier spécifiant la quantité maximale <strong>de</strong> ban<strong>de</strong> passante pouvant être utilisée par la vidéo<br />

sortante actuelle, en octets. Une valeur <strong>de</strong> 0 signifie que la vidéo Flash peut utiliser autant <strong>de</strong><br />

ban<strong>de</strong> passante que nécessaire pour conserver la qualité d'image voulue.<br />

Pour configurer cette propriété, appelez Camera.setQuality().<br />

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

Exemple<br />

L'exemple suivant modifie la quantité maximale <strong>de</strong> ban<strong>de</strong> passante utilisée par la caméra.<br />

Créez une nouvelle occurrence vidéo en sélectionnant Nouvelle vidéo dans le menu d'options<br />

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

occurrence <strong>de</strong> composant NumericStepper intitulée bandwidth_nstep à la scène. Ajoutez<br />

ensuite le co<strong>de</strong> <strong>ActionScript</strong> suivant à l'image 1 <strong>du</strong> scénario :<br />

var bandwidth_nstep:mx.controls.NumericStepper;<br />

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

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

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

this.createTextField("bandwidth_txt", this.getNextHighestDepth(), 0, 0,<br />

100, 22);<br />

bandwidth_txt.autoSize = true;<br />

this.onEnterFrame = function() {<br />

bandwidth_txt.text = "Camera is currently using "+my_cam.bandwidth+"<br />

bytes ("+Math.round(my_cam.bandwidth/1024)+" KB) bandwidth.";<br />

};<br />

//<br />

bandwidth_nstep.minimum = 0;<br />

bandwidth_nstep.maximum = 128;<br />

bandwidth_nstep.stepSize = 16;<br />

bandwidth_nstep.value = my_cam.bandwidth/1024;<br />

function changeBandwidth(evt:Object) {<br />

my_cam.setQuality(evt.target.value 1024, 0);<br />

}<br />

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

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

Saved successfully!

Ooh no, something went wrong!