How to gradient color
fill shapes with actionscript:
- Click on the first
keyframe then open the actions panel".
- Copy and
paste this code in the "Actions" panel:
fillType = "linear";
colors = [0xF83680, 0x5844EA];
alphas = [100, 100];
ratios = [0, 255];
matrix = {matrixType:"box", x:50, y:50,
w:150, h:100, r:0/180*Math.PI};
_root.lineStyle(2, 0x666666, 100);
_root.beginGradientFill(fillType, colors, alphas,
ratios, matrix);
_root.moveTo(50, 50);
_root.lineTo(200, 50);
_root.lineTo(200, 150);
_root.lineTo(50, 150);
_root.lineTo(50, 50);
_root.endFill();
- Press Ctrl + Enter to test
the movie.
|