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.

}<br />

this.filters = arr;<br />

function setUpFilter(name:String):MovieClip {<br />

var art:MovieClip = this.createEmptyMovieClip(name,<br />

this.getNextHighestDepth());<br />

var w:Number = 150;<br />

var h:Number = 150;<br />

art.beginFill(0xCCCCCC);<br />

art.lineTo(w, 0);<br />

art.lineTo(w, h);<br />

art.lineTo(0, h);<br />

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

}<br />

var colors:Array = [0xFFFFFF, 0xCCCCCC, 0x000000];<br />

var alphas:Array = [1, 0, 1];<br />

var ratios:Array = [0, 128, 255];<br />

var filter:GradientBevelFilter = new GradientBevelFilter(5, 225, colors,<br />

alphas, ratios, 5, 5, 5, 2, "inner", false);<br />

art.filters = new Array(filter);<br />

return art;<br />

Voir également<br />

alphas (propriété GradientBevelFilter.alphas), colors (propriété<br />

GradientBevelFilter.colors), beginGradientFill (métho<strong>de</strong><br />

MovieClip.beginGradientFill)<br />

strength (propriété GradientBevelFilter.strength)<br />

public strength : nombre<br />

L'intensité <strong>de</strong> l'impression ou <strong>du</strong> recouvrement. Plus la valeur est élevée, plus l'intensité <strong>de</strong>s<br />

couleurs apparaît à l'impression et plus le contraste est important entre le biseau et l'arrièreplan.<br />

Les valeurs vali<strong>de</strong>s sont comprises entre 0 et 255. La valeur 0 signifie que le filtre n'est<br />

pas appliqué. La valeur par défaut est 1.<br />

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

Exemple<br />

L'exemple suivant montre comment définir la propriété strength sur un objet existant.<br />

import flash.filters.GradientBevelFilter;<br />

var mc:MovieClip = setUpFilter("strengthExample");<br />

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

GradientBevelFilter (flash.filters.GradientBevelFilter) 651

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

Saved successfully!

Ooh no, something went wrong!