greetings to you all!
I want to insert a flash object in my code.and i get validation errors.
what is the best way of doing things.here is the code and below it the errors. pliz let me know how i can correct it.

<object width="200" height="200">
<param name="movie" value="flash/filename.swf">
<embed src="flash/filename.swf" width="200" height="200">
</embed>
</object>

and these are the errors that i get

Error 1 Validation (XHTML 1.0 Transitional): Empty elements such as 'param' must end with />.
Error 2 Validation (XHTML 1.0 Transitional): Element 'embed' is not supported.


thanks labelle

Dani AI

Generated

reported two validator complaints: empty elements like param must be self-closed in XHTML, and embed is not part of the XHTML 1.0 DTD so it will always trigger “not supported” even though many browsers historically accepted it. and pointed out practical embed snippets and controls that work in browsers, but those approaches commonly rely on embed (or generated non‑valid markup), which explains the validation warning.

A validator‑friendly pattern that keeps cross‑browser support is to avoid <embed> and use a nested <object> fallback (outer object for IE ActiveX, inner object for plug‑in aware browsers), with all param elements self‑closed. Example (adapt paths and dimensions as needed):

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="200">
  <param name="movie" value="flash/filename.swf" />
  <param name="quality" value="high" />
  <object type="application/x-shockwave-flash" data="flash/filename.swf" width="200" height="200">
    <param name="movie" value="flash/filename.swf" />
    <p>Flash content not available. Provide an alternative (video or link).</p>
  </object>
</object>

Practical troubleshooting and long‑term notes: serve the .swf over HTTP with the correct MIME (application/x-shockwave-flash), avoid spaces in filenames, and use correct relative/absolute paths. For server/client detection and clean markup, a small JS helper (e.g., SWFObject) can write the appropriate <object> at runtime and supply fallbacks. Keep in mind that Adobe ended support for Flash on December 31, 2020 and modern browsers have removed plugin support, so relying on SWF long‑term is fragile; migrating animations to HTML5/Canvas/MP4 or using an emulator like Ruffle is the safer path. For ’s Visual Studio issue, confirm pages are served over HTTP (not file://) and that any ActiveX/plugin requirements are met during testing.

Recommended Answers

All 5 Replies

bleuh inserting .swf files is such a tricky thing to make browser safe. I find that using the folllowing code that i think dreamweaver gave me is the best iv found! although i have not had much experiance with this at all, i have had some. Below is the code:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[URL]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0[/URL]" width="550" height="400" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="videos/hdsd mov.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="LOOP" value="false"><embed src="videos/hdsd mov.swf" width="550" height="400" loop="false" align="middle" quality="high" bgcolor="#ffffff" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="[URL]" />
</object>

What this does is uses one script for embedding the swf for one type of browser, and in the <noscript> section which would be activated is another script, for the alternative browsers. Just edit in your own preferences, and it should work. Hope this hepls!!

Max.

Thanx a lot for yr reply. and it did help me.
one validation error is out now but i still have one. the element embed is not supported. so which one is supported.
I am developing the site for these browsers: xhtml 1.0 Transitional(Netscape 7, Opera 7, Internet Explorer 6). here is the exact error that i get.
Validation (XHTML 1.0 Transitional): Element 'embed' is not supported.

Thanx a lot

bleuh inserting .swf files is such a tricky thing to make browser safe. I find that using the folllowing code that i think dreamweaver gave me is the best iv found! although i have not had much experiance with this at all, i have had some. Below is the code:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[URL]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0[/URL]" width="550" height="400" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="videos/hdsd mov.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="LOOP" value="false"><embed src="videos/hdsd mov.swf" width="550" height="400" loop="false" align="middle" quality="high" bgcolor="#ffffff" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="[URL]" />
</object>

What this does is uses one script for embedding the swf for one type of browser, and in the <noscript> section which would be activated is another script, for the alternative browsers. Just edit in your own preferences, and it should work. Hope this hepls!!

Max.

or else you can use the FREE flash control from:
http://www.flash-control.net/

its FREE!

i am using the same control for my entire project!

regards,

Ammar.

Thanx a lot .
i am using the control and it seems to be working in IE. I am hoping it works for all the browsers, ok lets sya for most of the browsers especially the most commonly used.
Thanx a lot

Labelle

hi there,
i have downloaded flash control and used it in my visual studio 2005 but its not working.
i tried a lot of time, but is not showing up anything when i am running up my application..

and the oher way of using the flash by writing code too is not working here in my system, showing no error message, but still not working..
please help..

regards
darshan
<EMAIL SNIPPED>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.