Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2008, 08:52 PM   PM User | #1
Darren_Clark
New Coder

 
Join Date: Mar 2008
Location: Leeds, UK
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Darren_Clark is an unknown quantity at this point
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!
Darren_Clark is offline   Reply With Quote
Old 03-16-2008, 10:20 PM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Users who have thanked gnomeontherun for this post:
Darren_Clark (03-17-2008)
Old 03-17-2008, 08:14 AM   PM User | #3
Darren_Clark
New Coder

 
Join Date: Mar 2008
Location: Leeds, UK
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Darren_Clark is an unknown quantity at this point
That's great.. I'll take a look thanks!
Darren_Clark is offline   Reply With Quote
Old 03-17-2008, 08:44 PM   PM User | #4
Darren_Clark
New Coder

 
Join Date: Mar 2008
Location: Leeds, UK
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Darren_Clark is an unknown quantity at this point
Ok..

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:

http://www.darrenclarkdesign.com/NEW...ontesting.html

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

Can anybody help?
Darren_Clark is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:55 AM.


Advertisement
Log in to turn off these ads.