How to exactly center swf in dreamweaver?

How do you make the flash swf to be in the the EXACT center of the browser window?

In dreamweaver, it only allows my to highlight the swf when i inserted it and then go to align–>center.

I want it to be exactly in the middle of the browser window.

Its easy but i dont know…please explain!

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12874 :sigh:

Lostinbeta, thanks, but i believe you misunderstood what i said.

I have a 150 x 150px image, and i want it to remain those dimensions, but be at the exact center of the browser window.

In flash i can center anything via the align panels. It is a piece of chocolate cake.

But dreamweaver is not that good at allowing people to put things exactly where they want them.

I wish the image to be in the exact center of the wondow when viewed in the browser.

Can you help?

My sincerest apologies. It seems i misunderstood you.

I don’t understand what that post is asking me to do. I mean, do i put the image in a table?

Can you clarify?

Sorry :frowning:

:beam:

Where the “<!–embed code here–>” is in that script you replace that with your .swf embed code or image code or whatever you want to be centered in the area.

so all i do is copy and paste that html code into the script in dreamweaver and just enter my swf’s name?

That’s it? Cos it doesn’t seem to work :-/

Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>[ 10 second trailer ]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<TABLE WIDTH="100%" HEIGHT="100%">
<TR><TD WIDTH="100%" HEIGHT="100%" ALIGN="center" VALIGN="middle">

<trailer.swf>

</TD>
</TR>
</TABLE>

<body bgcolor="#7C83CD">
<div align="center">
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="550" height="400">
    <param name="movie" value="trailer.swf">
    <param name="quality" value="high">
    <embed src="trailer.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400"></embed></object>
</div>
</body>
</html>

It doesn’t seem to work…this is what i get:

http://www.hinduvidya.com

It sends it right to the bottom

view this html

http://www.hylansupply.com

Yah that is the exact effect i am going for {by the way hinduvidya.com is my site…)

Do you know why i can’t achieve this effect?

let me look at your code

hmm ur gonna have to post your fla. i forgot how i did it, i have to do it from scratch

when i add my swf to dreamweaver, there must be a simple way to align the swf in the absolute middle of the page.

That is what i mean. Nothing to do with the swf/fla itself.

Dreamweaver frustratingly doesn’t allow you to align things the easy way.

Someone must know how to do it!

this works i tested it


<HTML>

<HEAD>

<meta http-equiv=Content-Type content="text/html;  charset=ISO-8859-1">

<TITLE>test</TITLE>

</HEAD>

<SCRIPT language="JavaScript">
self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
</SCRIPT>

<script language="javascript">

/* Variable Declarations */
var isMac = (navigator.userAgent.indexOf("Macintosh") != -1);
var isWin = (navigator.userAgent.indexOf("Windows 95") != -1 || navigator.userAgent.indexOf("Windows NT") != -1);
var isNS =  (navigator.appName == "Netscape");
var isIE =  (navigator.userAgent.indexOf("MSIE") != -1);
var ieWin = (navigator.userAgent.indexOf("MSIE") != -1 && (navigator.userAgent.indexOf("Windows 95") != -1 || 

navigator.userAgent.indexOf("Windows NT") != -1));
/*Kill*/
function reload() {

			if (window.parent.frames.length > 1) {
				window.open("http://www.yourdomain", "_top")
			}
		}
/* Working Around Netscape Resize Bug */
if (isNS){
	origWidth = innerWidth;
	origHeight = innerHeight;       
}

/* Function: Restoring The Size */        
function restore(){       
	if (innerWidth != origWidth || innerHeight != origHeight){
	location.reload();
	}
}       

/* Function: Restoring The Size */        
if (isNS){
	onresize = restore;
}


</script>


<BODY bgcolor="#FFFFFF" class="Target">

<table width="100%" border="0" height="100%">
  <tr align="center" valign="middle"> 
    <td>

<!-- URL's used in the movie-->

<A HREF=home.swf></A> <A HREF=hardware.swf></A> <A HREF=electric.swf></A> <A HREF=plumbing.swf></A> <A HREF=contact.html></A> <!-- text used 

in the movie-->

<!--LoadingWELCOME TO HYLAN SUPPLY.COM. .  ....--><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
 WIDTH="110" HEIGHT="110" id="" ALIGN="">
 <PARAM NAME=movie VALUE="http://www.hinduvidya.com/button_10st.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> 

<EMBED src="index_003.swf" quality=high bgcolor=#FFFFFF  WIDTH="110" HEIGHT="110" NAME="" ALIGN=""
 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>

</OBJECT>

</td>

</tr>

</table>

</BODY>

</HTML>

i messed about with your code, and it seems as long as you paste this:

<SCRIPT language="JavaScript">
self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
</SCRIPT>

That is all that is required.

Doesn’t make sense, but if you check my site:

http://www.hinduvidya.com

you can see it works.

If only i knew how :nerd:

yea i wasnt sure what you needed. when i made that site i just used estudio’s javascript to get it to relaunch and center liek that

ok this is what i figured.

That javascript is what makes the new window without the buttons.

Except i STILL don’t know how to center something in dreamweaver :sleep:

you can center anything by clicking on it and going to align = center.

you can’t do what u just did with out JS

If you right click soemthing, dreamweaver aligns it in the center HORIZONTALLY (not vertically as well).

In flash mx i can put something in the middle of both x and y axis.

It must be a very easy thing to do, someone must know.

If it must be done with js, what is the code?

omg u just wrote the code


<SCRIPT language="JavaScript">
self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
</SCRIPT>

im done with this thread. and stop saying someone must know, the answer is in front of you

NO.

This code is used to open the url in a new window without any buttons.

This has nothing to do with re-aligning objects.