Align Problem

My Flash can't align at the center of the page?

Page 1 of 1

1 Replies - 1858 Views - Last Post: 11 October 2009 - 02:42 AM

#1 mumeisyuu  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 55
  • Joined: 03-October 08

Align Problem

Post icon  Posted 29 September 2009 - 11:04 PM


I have made a Flash with Flash CS3 and published it; at the setting I have confirmed to set the alignment for both vertical and horizontal to be center. However, after I published it and opened it with both Mozilla Firefox or I.E., the Flash isn't aligned at the center but to the top-left....

Below is the code when its published:
<html xmlns="" xml:lang="zh_tw" lang="zh_tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<body bgcolor="#ff0000">
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js。");
	} else {
			'codebase', ',0,0,0',
			'width', '716',
			'height', '180',
			'src', 'topMenu',
			'quality', 'high',
			'pluginspage', '',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'topMenu',
			'bgcolor', '#ff0000',
			'name', 'topMenu',
			'menu', 'true',
			'allowFullScreen', 'false',
			'movie', 'flash/topMenu',
			'salign', ''
			); //end AC code
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=",0,0,0" width="716" height="180" id="topMenu" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="flash/topMenu.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ff0000" />	<embed src="flash/topMenu.swf" quality="high" bgcolor="#ff0000" width="716" height="180" name="topMenu" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="" />

I can't see why it isn't working... ><"
Can somebody help?

Also, I remember seeing some Flash implementation is:
Having a Flash as a menu button bar at the top of the page, then by clicking the button in the Flash, the content of the bottom part of the page changes (non-frame) How is this done? Any tutorial on the web? Because I don't even know what I should search for :(

Many thanks :D

Is This A Good Question/Topic? 0
  • +

Replies To: Align Problem

#2 iRaptureJoshua  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 20
  • Joined: 09-October 09

Re: Align Problem

Posted 11 October 2009 - 02:42 AM

I don't think this is actually a problem with your flash. It looks like something you will need to solve with either HTML or CSS as the alignment of the object within the web page is ultimately controlled outside of the swf. Using CSS styles to center a flash object horizontally is pretty easy and can be addressed within your body tag.

<body style="width:716px; margin:auto; background-color:#ff0000;">

This will set the width of the body element to be equal to the current width of your swf file. The margins will then divide the total remaining width of the browser window between the left and right sides, effectively centering your Flash. It will also set the background color that your current body tag is setting.

<body style="text-align:center; background-color:#ff0000;">

This will center all of the text on the web page, your embedded flash object will center as well.

Now centering something vertically is harder than it is to center horizontally. I don't know of a reliable, cross-platform method. You might try posting in the CSS area to see if anyone has a method they find works.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1