Why define param elements twice with static publishing?

52 views
Skip to first unread message

raider5

unread,
Dec 8, 2009, 11:52:24 AM12/8/09
to SWFObject
Hi all,

Was looking at the markup for static publishing and wondered why the
docs suggest declaring the param elements twice?

"NOTE: The nested-objects method requires a double object definition
(the outer object targeting Internet Explorer and the inner object
targeting all other browsers), so you need to define your object
attributes and nested param elements twice."

Are there issues in using just one set of params as shown below?

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="780" height="420">
<!--[if !IE]>--><object type="application/x-shockwave-flash"
data="myContent.swf" width="780" height="420"><!--<![endif]-->
<param name="movie" value="myContent.swf" />
<param name="wmode" value="opaque" />
<param name="allowfullscreen" value="true" />
<p>Alternative content</p>
<!--[if !IE]>--></object><!--<![endif]-->
</object>

Cheers,

SJ

Sam Sherlock

unread,
Dec 8, 2009, 12:53:23 PM12/8/09
to swfo...@googlegroups.com
one set of params is for IE the other not - you need to replicate the params but not the movie one

generate you code and compare with the wiki examples
- S




2009/12/8 raider5 <rai...@hotmail.co.uk>

--

You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.



Getify Solutions, Inc.

unread,
Dec 8, 2009, 1:59:09 PM12/8/09
to swfo...@googlegroups.com
Actually, it seems to me that SJ's suggestion makes sense. I can't see any reason why, for non-IE, the <param> elements must appear in both the outer <object> *and* the inner <object>. It seems that non-IE simply ignores the outer <object> (using the inner one instead) and so the outer one not having the duplicated <param>s would be irrelevant. But perhaps we're missing something that Bobby knows.
 
--Kyle

Philip Hutchison

unread,
Dec 8, 2009, 4:33:01 PM12/8/09
to swfo...@googlegroups.com
there's one significant difference: the outer object uses the "movie" param for the URL of the file, while the inner object uses the data attribute to specify URL.


<param name="movie" value="myContent.swf" />

so SJ's example would need to be modified to:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
     <param name="movie" value="myContent.swf" />
     <!--[if !IE]>--><object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"><!--<![endif]-->
     <param name="wmode" value="opaque" />
     <param name="allowfullscreen" value="true" />
     <p>Alternative content</p>
     <!--[if !IE]>--></object><!--<![endif]-->
</object>


both approaches are valid.  it's a matter of personal preference, and bobby decided on the current SWFObject syntax.  my only concern with SJ's method is that it probably makes the author more likely to overlook the fallback content. however, this is a really this is a minor point, and very debatable. if a code generator is used, it's completely moot.

- philip

Getify Solutions, Inc.

unread,
Dec 8, 2009, 4:39:20 PM12/8/09
to swfo...@googlegroups.com
Isn't it true that the where the "movie" param shows up is irrelevant? I know the inner object will use it's data attribute, but doesn't that mean it'll probably just ignore the inner movie param if it finds it? as long as the two have the same URL, doesn't seem like it should cause a problem.
 
--Kyle

raider5

unread,
Dec 8, 2009, 4:57:02 PM12/8/09
to SWFObject
Hi,

Thanks for the responses. I was just in the process of testing this!
The initial markup I posted did have an issue in Safari 3 (win), so I
grabbed a copy of the following params page from the test suite:

http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_params.html

I've modified the markup in it so it reads as follows:

<!--[if IE]><object id="myId" classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" width="300" height="120"><![endif]-->
<!--[if !IE]>--><object type="application/x-shockwave-flash"
data="test6_flashvars.swf" width="300" height="120"><!--<![endif]-->
<param name="movie" value="test6_flashvars.swf" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
<param name="flashvars"
value="name1=hello&amp;name2=world&amp;name3=foobar" />
<div>
<h1>Alternative content</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img
src="test_params_files/get_flash_player.gif" alt="Get Adobe Flash
player" /></a></p>
</div>
</object>

I've tested the modified "test_params.html" page in the following
browsers and everything works 100%. The results are all win based, if
anyone can test mac that would be good:

IE - 6, 7, 8
FF - 2, 3.5, 3.6(alpha)
Safari - 3, 4
Opera - 9+
Chrome - 3

The movie param, as Kyle has said, shouldn't be an issue. It's a
parameter so it'll be ignored if it isn't supported I would have
thought.

The main problem with the current syntax is that it adds a lot of page
weight which I don't think is necessary, especially if there are a lot
of flash vars. The above syntax avoids this and seems to work fine.

Cheers,

SJ

Philip Hutchison

unread,
Dec 8, 2009, 7:10:16 PM12/8/09
to swfo...@googlegroups.com
Yes, that's true... I just don't like placing elements in a spot where I know they're not being used.  Again, it's a personal preference more than anything. No right or wrong way. Overall, I do like the succinctness of SJ's version.

- philip

raider5

unread,
Dec 9, 2009, 8:42:00 AM12/9/09
to SWFObject
The revised markup has now been tested more thoroughly. It has been
put through browser cam and tested on win, mac, linux, with the
following browsers:

IE, Firefox, Safari, Chrome, Opera

For comparison, the original "test_params.html" page and the modified
page have been tested together. The modified page has a red background
for a quick visual comparisons. The results (screenshots) from the
testing can be found on the following link:

http://dl.dropbox.com/u/3417104/swfobject/browsers.zip

As you'll see from the results there is no difference between the
original and modified versions. Unless anyone can point out any
reasons for not using the modified markup? I personally would use it.
It has a lot less page weight, uses one object per flash video instead
of two, and the syntax I feel is more succinct.

Cheers,

SJ

Shade

unread,
Dec 15, 2009, 2:23:30 PM12/15/09
to SWFObject
Actually, on the topic of the "movie" param... turns out it does break
Safari. Just tested this on a page, and Safari would load if the movie
param were only in the outer object, but if all i did was move it to
the inner object, it would fail to load the movie. And yes, it had the
exact same URL as the "data" attribute.

So, this shorter syntax works fine, but with the caveat that the
"movie" param must only be in the outer object.


--Kyle




On Dec 8, 3:57 pm, raider5 <raid...@hotmail.co.uk> wrote:
> Hi,
>
> Thanks for the responses. I was just in the process of testing this!
> The initial markup I posted did have an issue in Safari 3 (win), so I
> grabbed a copy of the following params page from the test suite:
>
> http://www.bobbyvandersluis.com/swfobject/testsuite_2_2/test_params.html
>
> I've modified the markup in it so it reads as follows:
>
> <!--[if IE]><object id="myId" classid="clsid:D27CDB6E-
> AE6D-11cf-96B8-444553540000" width="300" height="120"><![endif]-->
> <!--[if !IE]>--><object type="application/x-shockwave-flash"
> data="test6_flashvars.swf" width="300" height="120"><!--<![endif]-->
>         <paramname="movie" value="test6_flashvars.swf" />
>         <paramname="menu" value="false" />
>         <paramname="wmode" value="transparent" />
>         <paramname="flashvars"
> value="name1=hello&name2=world&name3=foobar" />
>         <div>
>                 <h1>Alternative content</h1>
>                 <p><a href="http://www.adobe.com/go/getflashplayer"><img
> src="test_params_files/get_flash_player.gif" alt="Get Adobe Flash
> player" /></a></p>
>         </div>
> </object>
>
> I've tested the modified "test_params.html" page in the following
> browsers and everything works 100%. The results are all win based, if
> anyone can test mac that would be good:
>
> IE - 6, 7, 8
> FF - 2, 3.5, 3.6(alpha)
> Safari - 3, 4
> Opera - 9+
> Chrome - 3
>
> The movieparam, as Kyle has said, shouldn't be an issue. It's a

raider5

unread,
Dec 15, 2009, 9:03:08 PM12/15/09
to SWFObject
Hi Kyle,

Any chance you could post up the code you were trying? Also what OS
and Safari version was it breaking in?

The results of tests I performed came back showing it was working in
all Safari versions on both win and mac. The results can be found on
But yeah, it's a trivial fix, just add the movie param to the IE only
conditional comment e.g.

<!--[if IE]><object id="myId" classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" width="300" height="120">
<param name="movie" value="test6_flashvars.swf" /><![endif]-->
<!--[if !IE]>--><object type="application/x-shockwave-flash"
data="test6_flashvars.swf" width="300" height="120"><!--<![endif]-->
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
<param name="flashvars"
value="name1=hello&name2=world&name3=foobar" />
<div>
<h1>Alternative content</h1>
<p><a href="http://www.adobe.com/go/getflashplayer"><img
src="test_params_files/get_flash_player.gif" alt="Get Adobe
Flashplayer" /></a></p>
</div>
</object>

Cheers,

SJ
Reply all
Reply to author
Forward
0 new messages