...

View Full Version : Converting <embed> to <object>



JaymeNYC
11-03-2008, 08:55 PM
<embed type="application/x-shockwave-flash" src="/3/flash/h1.swf" style="" bgcolor="#F4F9FF" quality="high" flashvars="link=LinkURL&amp;txtName=login" height="29" width="250">
</div>

Hwo can I convert this so it validates in xhtml strict?:confused:

harbingerOTV
11-03-2008, 10:24 PM
embed and object won't validate. Use the swfobject method instead:
http://blog.deconcept.com/swfobject/

_Aerospace_Eng_
11-04-2008, 06:10 AM
embed and object won't validate. Use the swfobject method instead:
http://blog.deconcept.com/swfobject/

Object will validate but I agree its better to use swfobject however there is a newer version out. The link posted is to version 1.5 but the latest version is 2.0.

http://code.google.com/p/swfobject/

Apostropartheid
11-04-2008, 12:36 PM
I would third SWFObject, but I've found that a simple object will do the trick most of the time.

<object type="application/x-shockwave-flash" data="/3/flash/h1.swf" height="29" width="250">
<param name="bgcolor" value="#F4F9FF"/>
<param name="quality" value="high"/>
<param name="flashvars" value="link=LinkURL&amp;txtName=login"/>
</object>

VIPStephan
11-04-2008, 05:37 PM
SWFobject is better in terms of progressive enhancement (http://en.wikipedia.org/wiki/Progressive_enhancement), though.

Major Payne
11-05-2008, 04:14 AM
<embed type="application/x-shockwave-flash" src="/3/flash/h1.swf" style="" bgcolor="#F4F9FF" quality="high" flashvars="link=LinkURL&amp;txtName=login" height="29" width="250">
</div>

Hwo can I convert this so it validates in xhtml strict?:confused:Insert your embed tag info inside JS and it will validate. Just remember the inherent problem that viewers may have JS turned off and you may want to add noscript tags to warn them to turn JS on.

Example:
<script type="text/javascript">document.write("<embed type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='#000065' showcontrols='true' showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' style='width: 320px; height: 285px;' src='http://l.yimg.com/a/i/mntl/ww/06q3/yodel.swf' autostart='true' designtimesp='5311' loop='true' />")</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum