|
Full Page Gradients
Is there anyway to create a full page gradient which changes dependant on the size of the browser window? I have found some coding that creates a gradient which is the size of the stage, however once the browser window is bigger than the stage you get a border around the edge.
Clearly you could make the stage really large, but that would increase loading times and surely there's another way?
Here's the code I used for the entire stage gradient:
wSize = Stage.width;
hSize = Stage.height;
fillType = "linear";
colors = [0x333366, 0x606BD2];
alphas = [100, 100];
ratios = [0, 255];
matrix = {matrixType:"box", x:0, y:0, w:wSize, h:hSize, r:90/180*Math.PI};
_root.lineStyle(1, 0xFFFFFF, 0);
_root.beginGradientFill(fillType, colors, alphas, ratios, matrix);
_root.lineTo(wSize, 0);
_root.lineTo(wSize, hSize);
_root.lineTo(0, hSize);
_root.lineTo(0, 0);
_root.endFill();
Any help is appreciated!
|