FORUMS: list search recent posts

Flash implement / monitor sizes

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nicole Kuderer
Flash implement / monitor sizes
on May 27, 2008 at 12:06:37 pm


I am building my homepage completely in Flash.
How shall I set up the measurements and implement the file into Dreamweaver so it will fit into most browser windows without people have to scroll down?


Return to posts index

Pieter Helsen
Re: Flash implement / monitor sizes
on May 27, 2008 at 1:18:18 pm

There are two solutions. An easy one and a slightly more difficult one.

The easy one is assuming that 1024x786 is today's standard screen resolution. A document size of 960x560px makes sure that it will fit easily in most browsers. Be sure to set the HTML body's padding and margins to 0. It's not necessary, but it looks better...

The second is allowing for your flash to work in full screen. This requires a bit of math and some help from the static variables Stage.width and Stage.height.
Basically, what you're gonna do is make sure that the flash file is stretched to 100% so that it fills the entire screen (like when you are looking at a .swf file in a browser, rather than a .html file with the .swf embedded into it. It gets stretched out.) Now to keep your content from scaling (and usually horribly distorting) we're gonna need a little bit of code.

Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.showMenu = false;

This bit of code should go (for clarity's sake) on a seperate layer called Actions:Stage above all other layers. It will make sure that, no matter how far your stage gets stretched, your content remains the same.

Now, this is just one part of the code. The second part, is to make sure that, when the window resizes (for instance when the user maximizes his screen) your content stays in the same place relative to the Stage. In other words, that the content moves with the screen instead of staying in the same place. For an example, visit To do that, we need to attach a listener (which we already did on the last line of the above code) and then add the following code:

this.onResize = function(){
// This places a textfield with the instance name field_txt at an x and y position of 10 pixels
//and makes sure the textfield is spanning nearly the entire movie.
// field_txt._x = 10;
// field_txt._y = 10;
// field_txt._height = Stage.height - 20;
// field_txt._width = Stage.width - 20;
// This places the my_mc movieclip in the right and bottom position of the movieclip.
// my_mc._x = Stage.height - 20;
// my_mc._y = Stage.width - 20;
// This places the mySecond_mc movieclip in the middle of the screen.
//(assuming the registration point of your MC was set to top left.
// mySecond_mc._x = Stage.width/2 - mySecond_mc._width/2;
// mySecond_mc._y = Stage.width/2 - mySecond_mc._height/2;


Kind regards,

Return to posts index

Nicole Kuderer
Re: Flash implement / monitor sizes
on May 27, 2008 at 1:42:51 pm

Thanks a lot.

I just decided to skip Dreamweaver altogether (since it is a full flash page) and use the published html file. Whats the best way to do it then? Which size would be best to use for the flash document and which publish settings?
If I use "scale: exact fit", it gets horribly stretched....


thanks so much in advance...

Return to posts index

Pieter Helsen
Re: Flash implement / monitor sizes
on May 27, 2008 at 1:52:41 pm

Looks like you want to go with the second solution (are you somewhat familiar with Actionscript?)

These are the project settings:

Dimensions: Percent
Width & Height:
Scale: Default (this is set to No Scale via Actionscript)

Look at the above post to see how you have to set up the rest of your flash file.

Kind regards,

Return to posts index

Nicole Kuderer
Re: Flash implement / monitor sizes
on May 27, 2008 at 2:19:21 pm

Only very basic. But I am going to try and set it up exactly like you said...

Speaking of actionscript and Flash, i have another problem with some buttons I made:
I have a film reel (a little stripe consisting of thumbnails) moving over the screen. I tried to make buttons out of the thumbnails , so that if you mouseover it, it swaps to a bigger thumbnail (while still moving) and if you click on it, the movie stops and it opens a new scene.
Problems with both:
a) it does the mouseover but I wanted to have the bigger picture overlapping the ones next to it, but it is underneath. And "bring to front" didnt help..?
b) The "on release" button doesnt work at all....



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved