PDA

View Full Version : Align swf in page


equinas
12-09-2008, 01:46 PM
Hi,

I have a very simple swf that I would like to embed in a html page and align it centred. I have uploaded the files, I would be grateful if someone could give me a hand with this. It seems simple enough (Well if you know how!)

Additionally, which parameters in the html file do i change to resize the swf as I cant seem to get that working either!

Thanks for looking,

equinas

jasonJ
12-12-2008, 02:53 PM
Try to avoid the standard AC_RunActiveContent.js embeding way. It's much better to use swfobject (http://code.google.com/p/swfobject/wiki/documentation) instead, which I included in the archive. Now, there are 3 different html files:
2 of which use swfobject and center your movie with and without scaling. The third file is a slightly modified (css added) version of your original html. I'd strongly encourage you to use either of the first (swfobject) method.

F1@$H G33K
12-17-2008, 01:43 AM
You should probably just be able to put <center> tags around it.

For Example:


<center>
<!--EMBED SWF HERE-->
</center>

codemaster
12-18-2008, 09:44 PM
You could try this:


<div style="text-align: center;">
<!--EMBED SWF HERE//-->
</div>

I would, because it complies with the W3C Strict Guidelines, unlike:

<center>
<!--EMBED SWF HERE//-->
</center>



http://validator.w3.org/images/info_icons/error.png Line 1, Column 7: element "CENTER" undefined.<center> ✉ (http://validator.w3.org/feedback.html?uri=;errmsg_id=76#errormsg)
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:

incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).




Although the center tags are a WHOLE lot easier.

You should probably just be able to put <center> tags around it.

For Example:


<center>
<!--EMBED SWF HERE-->
</center>