PDA

View Full Version : Background stretched + exact fit contents



dsp_418
October 9th, 2003, 03:16 PM
Hi all,

I'd like to get something like hi-res.net home page.
As you can see the background is streched but not the contents.
Someone know how to get this with as?
TIA

dsp_418
October 10th, 2003, 04:37 AM
... anyone?

tequ1la
October 10th, 2003, 05:58 AM
id like to know that to...

dsp_418
October 12th, 2003, 12:44 PM
I'm not lucky ... :(

j0se
October 12th, 2003, 01:32 PM
view the page's source: (in ie - Menu: View/Source)

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="100%" HEIGHT="100%" id="index" ALIGN="">

when you place your swf on your html page, give it those dimensions


if i were you though, i'd simply set the page colour to the same as your flash movie (whatever size it is)

Voetsjoeba
October 12th, 2003, 02:05 PM
<body background="acertainimage.jpg" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>

:)

jeremy*
October 12th, 2003, 03:09 PM
I don't think anyone really looked at the page he/she posted.
The background image is not an img, its in the flash file.
Take a look, scale your browser window, notice the background scales, but the navigation stays. Also if it was as simple as just setting the movie at 100% the navigation would scale when the movie did. I think this has something to do with loaded movies, but do not have the time to mess around with this right now.
other pages similar to this:
the blood brothers (http://www.thebloodbrothers.com/home/index.html)
massive attack (http://www.massiveattack.co.uk/)

dsp_418
October 12th, 2003, 04:00 PM
Yes jeremy*, it's right.
Btw, I've tried other ways to get that effect, with standard css as well, but the only way to get it seems to be with Flash.

dsp_418
October 16th, 2003, 07:28 AM
this thing it's getting me crazy ... any idea guys?

Maizoon
October 16th, 2003, 06:16 PM
I remember seeing a tutorial here regarding passing variables from html to flash and back, but can't seem to find it at the moment. If I had to guess...and I am...I'd say thats what is going on. A variable from the html, window sizes maybe, is being passed to the movie and within the movie there is AS telling the nav and BG to size based on that variable. Only way I can think of how thats done.

j0se
October 16th, 2003, 06:31 PM
that sounds interesting...

you must be able to work out (with code) the user's resolution, pass that to flash and resize accordingly

now that's a handy thing to do - so I'll check back if I find anything

we're on a mission
:rambo:

j0se
October 16th, 2003, 06:41 PM
trace(System.capabilities.screenResolutionX);
trace(System.capabilities.screenResolutionY);
:cap:

so once you work out what size flash needs to be at any of the most popular 3 resolutions...

if(System.capabilities.screenResolutionX ==1024){

// set flash scale to x size
erm... code goes here
}

j0se
October 16th, 2003, 06:45 PM
actually, I just came across this, which seems the easiest way to achieve the full scale:

on(release){
fscommand("fullscreen", true);
}

http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary372.html

Maizoon
December 18th, 2003, 06:53 PM
Didn't mean to revive such an old thread, but a client of mine wanted an affect similiar to the one in this discussion. After alot of trial and error (I actually found the code by reading through the AS reference) I figured a way to do it and thought maybe some of you might like to know how...

I have 2 movies, index.swf and content.swf. I have one html page that loads index.swf at 100% x 100% (so index is stretched to fit the page) index.swf is empty except the following script:

stop();
_root.createEmptyMovieClip("container",1000);
MyX = 800;
MyY = 600;
container._x = (MyX-750)/2;
container._y = (MyY-500)/2;
Stage.scaleMode = "noScale"
container.loadMovie("content.swf");

and some random movement scripts which are basically background affects now that the content loads on top of everything else

MyX & MyY are set to the size of index.swf and the two lines following are to position "container" so as to center content.swf within index.swf. The entire site is held within content.swf and is loaded (not scaled) into index.swf which is set to 100% x 100%. The line:

Stage.scaleMode = "noScale"

is what does prevents content.swf from being scaled with the whole movie. So regardless of your browser size, the movie will cover the entire page but the content will remain constant. Just like hi-res.net :)

j0se
December 18th, 2003, 07:06 PM
Thank you for sharing that with us matey :)

It's simply clever, that is! I'll try and use it in my next project :azn:

adelpha
April 14th, 2004, 06:47 PM
cool! but how can i position the container more exact? (centered stuff sucks!)