all groups > macromedia flash sitedesign > september 2007 >
You're in the

macromedia flash sitedesign

group:

RESIZING TO WINDOW


RESIZING TO WINDOW Mista Sage
9/16/2007 12:00:00 AM
macromedia flash sitedesign:
Hi, does anyone know how I would go about to achieve something like this here:

http://www.brook-pifer.com/

Resize to window, and constrain an image's width/height to the window's
width/height?

I'm a total n00b to flash, but some insight would be GREATLY appreciated =)


Re: RESIZING TO WINDOW x1fm guy
9/17/2007 12:00:00 AM
oh well.. you could just pass the vars from javascript
i think in IE is called offsetwidth and offsetWidth and in mozilla clientWidth
(height too for both)
just call an external reference from actionscript within flash then resize it
al over again (only the Stage) mm i think thats the way i would do it.. would
have to check if its possible just guessing
Re: RESIZING TO WINDOW Rob Dillon
9/17/2007 11:00:26 AM
Use this javascript to position and resize the html window to the user's
screen:

self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);

and then set your Flash .swf's width and height to 100% each and set the
scale value to noscale.
--
Rob

___________
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
Re: RESIZING TO WINDOW Rob Dillon
9/17/2007 4:05:36 PM
Maybe what you're looking for is this:

margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;

That will keep the Flash movie butted up against the window edges.
--
Rob

___________
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
Re: RESIZING TO WINDOW Mista Sage
9/17/2007 7:47:05 PM
thanks guys for your reply.
But I mean, try resizing the window on the above website I gave.
See the image how it resizes to the width/height of the window so it doesn't
show blank space outside of the photo?

How do you constrain the photo so it doesn't show blank space in flash?
actionscript?
Re: RESIZING TO WINDOW Rob Dillon
9/20/2007 9:56:26 PM
That isn't actionscript, it's CSS.

You can put all of this in the body tag of the html doc that holds your
Flash movie. Something like this:

<body margin-left: 0px margin-top: 0px margin-right: 0px margin-bottom:
0px onLoad="self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);">

or, you can separate the CSS and the javascript and write them into
external documents.
--
Rob

___________
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
Re: RESIZING TO WINDOW Kusfraba
9/21/2007 1:08:37 AM
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;

Actually, I tried that, but I'm always getting a syntax error on the one that
I enter in first. All I have above it is a stop(); but that's not interfering
anway.
Here is what it looks like:

1 stop();
2
3 margin-left: 0px;
4 margin-top: 0px;
5 margin-right: 0px;
6 margin-bottom: 0px;
Re: RESIZING TO WINDOW Mr Martz
9/23/2007 11:13:47 PM
yes, I a wondering how to di this aswell. I tried entering the code that you
provided Rob and it didn't work. I also noticed a problem with some of you
atvice from above, you recommended settin the height and width to 100% in flash
and flash doesn't offer a percentage value. could you please elaborate on this?
Re: RESIZING TO WINDOW lenrique21
9/29/2007 6:07:02 PM

The BEST way to create a Flash website is by going to
http://www.flashden.net?ref=luke

check it out!! Great files for 0.5 U$S!!!


Re: RESIZING TO WINDOW Rob Dillon
10/8/2007 6:27:11 PM
From the file menu select "Publish Settings". From that window, select the
"HTML" button at the top. From that window, select the "Dimenions" option
pulldown. Select "percent". The values will usually change to 100 for width and
height. Move down to the "Scale" option in the same window. Select "No Scale".
Publish your movie.

Open the newly created HTML document, and add the CSS and Javascript as
described above.

You should now have a fully floating Flash movie inside the HTML document.
AddThis Social Bookmark Button