Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2008
    Location
    Leeds, UK
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.

  • Users who have thanked gnomeontherun for this post:

    Darren_Clark (03-17-2008)

  • #3
    New Coder
    Join Date
    Mar 2008
    Location
    Leeds, UK
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts
    That's great.. I'll take a look thanks!

  • #4
    New Coder
    Join Date
    Mar 2008
    Location
    Leeds, UK
    Posts
    12
    Thanks
    6
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •