Friday, September 19, 2008

Flash create line art using actionScript


code:

//top line---------------------------------------------------------------
h=0;
while (h<15) {
colors = [0x381EA6, 0x381EA6];
alphas = [30, 20];
ratios = [0, 0xFF];
matrix = {a:500, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
spreadMethod = "reflect";
interpolationMethod = "linearRGB";
focalPointRatio = 0.5;
lineStyle(1);
lineGradientStyle("linear", colors, alphas, ratios, matrix,
spreadMethod, interpolationMethod, focalPointRatio);
moveTo(0, 0 + (h * 50));
curveTo(500 + (h * 5), 100 + (h * 5), 200 + (h * 5), 0 + (h * 5));
curveTo(-400 + (h * 5), -170 + (h * 5), 1800 + (h * 100), 500 + (h * 100));
h++;
}

//bottom line------------------------------------------------------------
g=0;
while (g<15) {
colors = [0x381EA6, 0x381EA6];
alphas = [30, 20];
ratios = [0, 0xFF];
matrix = {a:500, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
spreadMethod = "reflect";
interpolationMethod = "linearRGB";
focalPointRatio = 0.5;
lineStyle(1);
lineGradientStyle("linear", colors, alphas, ratios, matrix,
spreadMethod, interpolationMethod, focalPointRatio);
moveTo(0, 0 + (g * 50));
curveTo(500 + (g * 5), 100 + (g * 5), 200 + (g * 5), 0 + (g * 5));
curveTo(-400 + (g * 5), -170 + (g * 5), 1800 + (g * 100), 500 + (g * 100));
g++;
}

No comments: