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.

color (propriété GlowFilter.color)<br />

public color : nombre<br />

La couleur <strong>du</strong> rayonnement. Les valeurs vali<strong>de</strong>s sont au format hexadécimal 0xRRVVBB. La<br />

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

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

Exemple<br />

L'exemple suivant modifie la propriété color sur un clip existant lorsqu'un utilisateur clique<br />

<strong>de</strong>ssus.<br />

import flash.filters.GlowFilter;<br />

var mc:MovieClip = createGlowFilterRectangle("GlowFilterColor");<br />

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

var filter:GlowFilter = this.filters[0];<br />

filter.color = 0x00FF33;<br />

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

}<br />

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

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

this.getNextHighestDepth());<br />

var w:Number = 100;<br />

var h:Number = 100;<br />

rect.beginFill(0x003366);<br />

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

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

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

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

rect._x = 20;<br />

rect._y = 20;<br />

}<br />

var filter:GlowFilter = new GlowFilter(0x000000, .8, 16, 16, 1, 3, false,<br />

false);<br />

var filterArray:Array = new Array();<br />

filterArray.push(filter);<br />

rect.filters = filterArray;<br />

return rect;<br />

constructeur GlowFilter<br />

public GlowFilter([color:Number], [alpha:Number], [blurX:Number],<br />

[blurY:Number], [strength:Number], [quality:Number], [inner:Boolean],<br />

[knockout:Boolean])<br />

Initialise une nouvelle instance GlowFilter avec les paramètres spécifiés.<br />

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

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

Saved successfully!

Ooh no, something went wrong!