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.

motionLevel_nstep.value = my_cam.motionLevel;<br />

// Continuously update the progress of the ProgressBar component instance to<br />

the activityLevel<br />

// of the current Camera instance, which is <strong>de</strong>fined in my_cam<br />

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

motion_pb.setProgress(my_cam.activityLevel, 100);<br />

};<br />

// When the level of activity goes above or below the number <strong>de</strong>fined in<br />

Camera.motionLevel,<br />

// trigger the onActivity event handler.<br />

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

// If isActive equals true, set the themeColor variable to "haloGreen".<br />

// Otherwise set the themeColor to "haloOrange".<br />

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

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

};<br />

function changeMotionLevel() {<br />

// Set the motionLevel property for my_cam Camera instance to the value<br />

of the NumericStepper<br />

// component instance. Maintain the current motionTimeOut value of the<br />

my_cam Camera instance.<br />

my_cam.setMotionLevel(motionLevel_nstep.value, my_cam.motionTimeOut);<br />

}<br />

motionLevel_nstep.addEventListener("change", changeMotionLevel);<br />

Voir également<br />

onActivity (gestionnaire Camera.onActivity), onStatus (gestionnaire<br />

Camera.onStatus), setMotionLevel (métho<strong>de</strong> Camera.setMotionLevel ),<br />

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

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

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

Nombre <strong>de</strong> millisecon<strong>de</strong>s entre le moment où la caméra arrête la détection <strong>du</strong> mouvement et<br />

le moment où Camera.onActivity (false) est appelé. La valeur par défaut est 2 000 (2<br />

secon<strong>de</strong>s).<br />

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

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

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

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

Saved successfully!

Ooh no, something went wrong!