WC3 compliant html for embedding flash

How can I modify the following html to make it WC3 compliant:

<embed src="img/something.swf" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Testing at http://validator.w3.org it says "This page is not Valid HTML 4.01 Transitional!" and it says there's no attributes for src, quality, type, pluginspace, and element "EMBED" undefined.


LVL 1
ncwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:
ncw,

The problem may be the way you are closing the tag.  "/>" is used to close XHTML tags that don't have closing tags.  Embed does have a closing tag and you should use it in HTML or XHTML.

<embed src="img/something.swf" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>

This may fix the validation error.  The rest of that code looks OK to me.

b0lsc0tt
0
ncwAuthor Commented:
No difference.

<embed src="img/something.swf" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
0
b0lsc0ttIT ManagerCommented:
ncw,

The problem may be that the embed tag was never standardized by W3C.  Who knows why that is the case?! Both of the links below are to articles that discuss this and seem to offer a way get flash to work in non-IE browsers and still use valid code that will meet standards.  If it is important to be compliant then you will probably have to use something like the solution in the articles.

http://www.macromedia.com/devnet/dreamweaver/articles/flash_satay.html

http://www.alistapart.com/articles/flashsatay/
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ncwAuthor Commented:
The full object code was:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="658" height="237" id="something" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="img/something.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="img/something.swf" quality="high" bgcolor="#ffffff" width="658" height="237" name="something" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

which I think matches the 'twice cooked' method in the links.
0
blacksixCommented:
I have a really good solution to this. I've used it on some sites and it validates no problemo (can even validate for XHTML 1.0 strict too!):

http://blog.deconcept.com/flashobject/

Its a script called flashobject. It's got some pretty good capabilities too (such as installing flash for those who do not have it without leaving your site).

Your code would look something like this:

First in your head section you would include the javascript file:
<script type="text/javascript" src="flashobject.js"></script>

Then put this where you want it to display:

<div id="flashcontent">
This text is replaced by the flash movie.
</div>
<script type="text/javascript">
 // <![CDATA[
  var fo = new FlashObject("fo_tester.swf", "fo_tester", "300", "150", 6, "#336699");
  fo.write("flashcontent");
 // ]]>
</script>

Again you can download the JS file and read more about the advantages of using this method here:
http://blog.deconcept.com/flashobject/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
uhh-ohhCommented:
I use a similar solution to blacksix's solution. I use Unobtrusive Flash Objects (UFO) V3.0 found here:
<a href="http://www.bobbyvandersluis.com/ufo/">http://www.bobbyvandersluis.com/ufo/</a>

From the site:
"UFO is as standards compliant as it can be. Your (X)HTML pages will pass the W3C validation tests, because UFO generates the Flash object's (X)HTML code with JavaScript."

It's free. It also provides you with the opportunity to put valuable content in place of the Flash when a user chooses not to have Flash installed. It has a lot of great features, the developer keeps up with it and maintains a very informative site, and most of all it's really easy to use.

Hope this helps.

--Susan


0
uhh-ohhCommented:
Oops, sorry about that problem with the link in my comment above. I'm new to posting here. My error.
0
sam85281Commented:
Hi uhh-ohhh

To make a link you just type it out, no code:
http://www.domain.com

-Sam
0
b0lsc0ttIT ManagerCommented:
ncw,

We have not heard you in a while.  Did any of the comments answer your question?  If so, please accept the appropriate comment with an excellent or good grade.  If you still have a question or need additional information then please let us know so that we can help you resolve the problem.

b
0
ncwAuthor Commented:
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.