-
ReMember
actually a html question..
Hi
I was wondering..knowing nothing about html...
the file that flash generates, how would I center my swf to the exact middle of the screen, and have a jpg picture be the background of the entire html page..
thanks
-
did0bib
-
Senior Member
You can make the movie appear in the centre of the page like this,
first add the following just before the opening <object> tag in your page,
<div id="movie">
and then add,
</div>
just after the closing </object> tag.
now between the opening <head> and closing </head> tags in your page add, (the following assumes a movie 500 pixels wide and 400 pixels high)
Code:
<style type="text/css">
#movie {
position: absolute;
left: 50%; top: 50%;
margin: -200px 0 0 -250px; padding: 0;
}
</style>
the
position: absolute;
left: 50%; top: 50%;
positions your movie so that its top left corner is centred on the page,
the
margin: -200px 0 0 -250px;
part nudges the movie up (by 200 pixels) and left (by 250 pixels) so that the centre of the movie is centred on the page.
if your movie is not 400 pixels high you would need to change -200px to be
-(half the height of your movie)px
and if it isn't 500 pixels wide you would need to change the -250px to be
-(half the width of your movie)px
-
ReMember
Thanks both of you..
So I have to some how splice the code the both of you have provided, I'll give it a try..
Thanks again
-
did0bib
No problem, gobbles.
Thanx catbert, I thought there might be a way to do this with CSS, but couldn't figure it out.
-
ReMember
I ran into a little problem being a html idiot...
I got the background picture thing working just fine, I just have a little problem with where to place the script from catbert..could you give me a pointer..
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome</title>
<style type="text/css">
<div id="movie.swf">
#movie {
position: absolute;
left: 50%; top: 50%;
margin: -200px 0 0 -250px; padding: 0;
}
body
{
background: #00ff00 url('back.png') no-repeat fixed center;
}
</style>
</head>
<body bgcolor="#ffffff">
</div>
</object>
</body>
</html>
thanks..
-
Senior Member
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome</title>
<style type="text/css">
#movie {
position: absolute;
left: 50%; top: 50%;
margin: -200px 0 0 -250px; padding: 0;
}
body {
background: #00ff00 url('back.png') no-repeat fixed center;
}
</style>
</head>
<body>
<div id="movie">
The object and embed tags for your movie go in here
</div>
</body>
</html>
-
ReMember
Thanks again.. I want a new header saying "helping Catbert303 getting 10.000 posts.."
-
Senior Member
-
ReMember
Sorry I just cant figure out what is what any longer..
My swf is called disko.swf and its 550x400
Could you help get it working then I might see the logic..
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>velkommen</title>
<style type="text/css">
#movie {
position: absolute;
left: 50%; top: 50%;
margin: -275px 0 0 -200px; padding: 0;
}
body {
background: #00ff00 url('back.png') no-repeat fixed center;
}
</style>
</head>
<body>
<div id="movie">
<table align="center">
<tr>
<td align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="movie" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="disko.swf" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="disko.swf" menu="false" quality="high" bgcolor="#ffffff" width="550" height="400" name="movie" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</div>
</body>
</html>
-
Senior Member
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>velkommen</title>
<style type="text/css">
#movie {
position: absolute;
left: 50%; top: 50%;
margin: -200px 0 0 -275px; padding: 0;
}
body {
background: #00ff00 url('back.png') no-repeat fixed center;
}
</style>
</head>
<body>
<div id="movie">
<object classid="clsid:D27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="disko.swf" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="disko.swf" menu="false" quality="high" bgcolor="#ffffff" width="550" height="400" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>
</body>
</html>
-
ReMember
-
I found i just had too add <center> near top of my html file and </center> near bottom.
-
Senior Member
using <center></center> only centers the movie on a horizontal scale, not vertical. The method catbert suggested would position the .swf to the centre on both.
Also, using the <center> tags is becoming a deprecated feature of W3C's HTML standards, so is best to try not to use if possible, and keep with CSS.
-
ReMember
Yes I actually tried that but the movie was only centered horizontaly and was place "1cm" from the top every time...same thing using "middle"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|