How to Open Flash movie in Center of Screen?

  [DELETED] 21:55 17 Aug 2003

Hi there. I have made a Flash movie, and was wondering if there is a way to position so it is in the center of ALL user's browser window? I obviously cant just poisition it a certain distance away from one side of the window as the resolution and window size varies from user to user. So is there some kind of code to tell the browser to display the movie in the middle of the window? Thanks a lot, Gavin

  [DELETED] 22:32 17 Aug 2003

You don't say which web editor you are using and the methods can differ dramatically from one to another, but...

You can horizontally centre your movie by wrapping it with the <div align="center"><div> tags, but this does not account for the verticals.

Dreamweaver has horizontal and vertical spacing for Flash inserts, but it's on a specified pixel basis so may not be appropriate.

Two tricks I've successfully used are as follows:

1. Make a single celled table where you specify the page margins top, bottom and both sides. This only needs to be a couple of pixels for our purposes, but the important thing is that all margins are the same size. Setting the table cell alignment to centre (both vertically and horizontally) automatically puts any objects or text inside it bang in the middle of the page.

You can remove the table border and set it's physical size slightly bigger in pixels than the movie itself.

2. Create a simple CSS for the page or entire site where you specify the vertical and horizontal alignment for the Flash class of object and reference it in your page code.

Example code for a simple table could be:

<table width="100%" width="100%">


<td align="center" valign="middle">

< your flash code goes in here>




Finally, the simplest way of all that I know of is to download the extremely useful Flash add-in called the "Center in Browser" extension. It does what it says on the tin, takes all the headaches out of things and answers you needs regardless of which web editor you use. You can find it at the Macromedia site and it's free to download if you register with them.

Hope this helps.



  Forum Editor 22:42 17 Aug 2003

the table method. It works perfectly, and is very quickly configured.

  [DELETED] 11:26 18 Aug 2003

Thanks a lot for yuor help, yet again quick and informative, much appreciated. I used Taran's second method and it as worked fine. Thanks again, Gavin

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Microsoft Surface Book 2 15in review

Illustrator Amy Grimes on how setting up her own eco-brand led to success with clients too

MacBook Pro keyboard issues and other problems

Test : l’enceinte connectée HomePod d’Apple