View Full Version : Full Page Gradients

03-16-2008, 08:52 PM
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);

Any help is appreciated!

03-16-2008, 10:20 PM
Increasing the stage size would not inherently increase loading time. The stage is created by flash on the load based on the parameters in the swf, unlike an image which has a rasterized size.

Why don't you resize the stage to the browser? http://www.tutorio.com/tutorial/liquid-flash-layout

03-17-2008, 08:14 AM
That's great.. I'll take a look thanks!

03-17-2008, 08:44 PM

So i've come up with this so far. I'm not entirely sure if I'm coding this correctly (results seem to suggest I'm not!)

I want the "menu" to hug the top left hand corner of the browser, the "footer/heading" to sit at the bottom right.. Then once completed I will add a central area for the main content.

This is what I have so far:


Also, it doesn't seem that the page is resizing at all. It is just staying in a constant position?

Can anybody help?