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.

}<br />

mc.lineTo(0, height);<br />

mc.lineTo(width, height);<br />

mc.lineTo(width, 0);<br />

mc.lineTo(0, 0);<br />

return mc;<br />

fillRect (métho<strong>de</strong> BitmapData.fillRect)<br />

public fillRect(rect:Rectangle, color:Number) : Void<br />

Remplit une zone rectangulaire <strong>de</strong> pixels avec une couleur ARVB spécifiée.<br />

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

Paramètres<br />

rect:flash.geom.Rectangle - La zone rectangulaire à remplir.<br />

color:Number - La valeur <strong>de</strong> couleur ARVB qui remplit la zone. Les couleurs ARVB sont<br />

souvent spécifiées au format hexadécimal, par exemple 0xFF336699.<br />

Exemple<br />

L'exemple suivant indique comment remplir une zone définie par un Rectangle dans un<br />

BitmapData à l'ai<strong>de</strong> d'une couleur.<br />

import flash.display.BitmapData;<br />

import flash.geom.Rectangle;<br />

var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);<br />

var mc:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc.attachBitmap(myBitmapData, this.getNextHighestDepth());<br />

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

myBitmapData.fillRect(new Rectangle(0, 0, 50, 40), 0x00FF0000);<br />

}<br />

Voir également<br />

Rectangle (flash.geom.Rectangle)<br />

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

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

Saved successfully!

Ooh no, something went wrong!