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.

lueMult:Number - Un nombre par lequel la valeur <strong>de</strong> canal blue doit être multipliée.<br />

alphaMult:Number - Un nombre par lequel la valeur <strong>de</strong> transparence alpha doit être<br />

multipliée.<br />

Exemple<br />

L'exemple suivant indique comment fusionner <strong>de</strong>ux parties d'une occurrence BitmapData.<br />

import flash.display.BitmapData;<br />

import flash.geom.Rectangle;<br />

import flash.geom.Point;<br />

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

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

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

this.getNextHighestDepth());<br />

mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());<br />

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

this.getNextHighestDepth());<br />

mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());<br />

mc_2._x = 101;<br />

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

bitmapData_1.merge(bitmapData_2, new Rectangle(0, 0, 50, 40), new<br />

Point(25, 20), 128, 0, 0, 0);<br />

}<br />

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

public noise(randomSeed:Number, [low:Number], [high:Number],<br />

[channelOptions:Number], [grayScale:Boolean]) : Void<br />

Remplit une image avec <strong>de</strong>s pixels représentant un bruit aléatoire.<br />

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

Paramètres<br />

randomSeed:Number - La valeur <strong>de</strong> départ aléatoire à utiliser.<br />

low:Number [facultatif] - La valeur la plus faible à générer pour chaque canal (<strong>de</strong> 0 à 255). La<br />

valeur par défaut est 0.<br />

high:Number [facultatif] - La valeur la plus élevée à générer pour chaque canal (<strong>de</strong> 0 à 255).<br />

La valeur par défaut est 255.<br />

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

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

Saved successfully!

Ooh no, something went wrong!