Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a newbie in webdesign and I´ve been wondering which is the modern way to embed swf objects.

I've been using the following html code:

<object id="flash1" data="presentacion/prototipe.swf" height="300" type="application/x-shockwave-flash" width="500">
<param name="movie" value="presentacion/prototipe.swf" />

However, I've noticed that some designers use a javascript to embed swf files. Like this one

<script type="text/javascript">
var flashvars = {

var params = {
    menu: "false",
    scale: "noScale",
    allowFullscreen: "true",
    allowScriptAccess: "always",
    allowNetworking: "all",
    bgcolor: "#ffffff",
    base: "swf/"
var attributes = {
swfobject.embedSWF("swf/flash_movie.swf", "flashMovie", "550", "400", "9.0.0", "swf/expressinstall.swf", flashvars, params, attributes);

It seems that both ways produce the same results but: what are the shorfalls of these methods? which method is the newest ? Are there any compatibility issues regarding the web-browsers?

Thanks in advance.

I've posted this question in stack-overflow too. I don't know exactly where this question should be posted.

share|improve this question

closed as off topic by John Conde Jul 12 '11 at 23:31

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I closed this as only one site needs to address this and StackOverflow is just as good as here for this question. – John Conde Jul 12 '11 at 23:32
The corresponding question on StackOverflow: Embedding *.swf objects: javascript vs xhtml – w3dk Jul 13 '11 at 9:38