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.

this.createEmptyMovieClip("my_mc", this.getNextHighestDepth());<br />

var grid:Rectangle = new Rectangle(20, 20, 260, 260);<br />

my_mc.scale9Grid = grid ;<br />

my_mc._x = 50;<br />

my_mc._y = 50;<br />

function onMouseMove()<br />

{<br />

my_mc._width = _xmouse;<br />

my_mc._height = _ymouse;<br />

}<br />

my_mc.lineStyle(20, 0xff3333, 100);<br />

var gradient_matrix:Matrix = new Matrix();<br />

gradient_matrix.createGradientBox(15, 15, Math.PI, 10, 10);<br />

my_mc.beginGradientFill("radial", [0xffff00, 0x0000ff],<br />

[100, 100], [0, 0xFF], gradient_matrix,<br />

"reflect", "RGB", 0.9);<br />

my_mc.moveTo(0, 0);<br />

my_mc.lineTo(0, 300);<br />

my_mc.lineTo(300, 300);<br />

my_mc.lineTo(300, 0);<br />

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

my_mc.endFill();<br />

Voir également<br />

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

scrollRect (propriété MovieClip.scrollRect)<br />

public scrollRect : Object<br />

La propriété scrollRect permet <strong>de</strong> parcourir rapi<strong>de</strong>ment le contenu <strong>du</strong> clip et d'ouvrir une<br />

fenêtre plus gran<strong>de</strong> pour afficher davantage <strong>de</strong> contenu. Les champs texte et le contenu<br />

défilent beaucoup plus vite dans la mesure où la copie au niveau <strong>de</strong>s pixels permet <strong>de</strong> faire<br />

défiler les données sans avoir à générer <strong>de</strong> nouveau tout le clip à partir <strong>de</strong> données vectorielles.<br />

Pour afficher le gain <strong>de</strong> performances, utilisez scrollRect en combinaison avec un clip dont<br />

le paramètre cacheAsBitmap est défini sur true.<br />

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

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

Saved successfully!

Ooh no, something went wrong!