How to Open Flash movie in Center of Screen?

  gplatt2000 21:55 17 Aug 03
Locked

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

  Taran 22:32 17 Aug 03

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%">

<tr>

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

< your flash code goes in here>

</td>

</tr>

</table>

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.

Regards

Taran

  Forum Editor 22:42 17 Aug 03

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

  gplatt2000 11:26 18 Aug 03

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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…