View Single Post
08-12-2004, 08:00 PM
#3
Evo is offline Evo
Status: Junior Member
Join date: Aug 2004
Location:
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

Evo is on a distinguished road

Send a message via MSN to Evo

  Old

I was about to post the satay method, then I saw the next post.
I looked through the discussion at ALA and noticed something new, the Javay method.
May aswell try it.

Originally Posted by RazorX
Well, the author of davidsonbicycles.com is simply wrapping <script type="text/javascript"> //<![CDATA[ around the embed tag. The embed tag is no longer a valid XHTML tag/element. The Flash Satay and many of the posts to it, have also confirmed that embed is no longer needed. Simply hiding it from the validator is not anything hair-raising, however, when the element is not needed, then it's a waste of code.

In trying to be XHTML compliant, the main issues revolve around the fact, that anytime IE 6 or less encounters the data element, it will not stream a movie.swf. To add to the problems, using a container movie to fix streaming in IE can add new troubles in Flash (read previous posts), also you cannot detect minor Flash player versions using client-side VBScript for an IE browser, so now your codebase="" becomes important to catch minor Flash versions in IE. Minor Flash detection becomes vital when determining what ActionScript elements to use or not to use based on bugs within a particular minor version and/or player release. All of these issues have been thoroughly covered in previous posts though.

So, all that being said, if I am being forced to use a JavaScript "hack and hide" with //<![CDATA[ to pass validation and to get IE to work right, then my personal choice is to feed IE what it wants. This allows me to maintain the ability to stream the larger .swf files, and still detect for minor Flash versions in the visiting IE browser if needed.

My preferred and final solution, which I have dubbed Javay, is a simple block of code I have tested in many browsers:

<script type="text/javascript" language="javascript">
//<![CDATA[ /// Flash Javay method
var ua = navigator.userAgent.toLowerCase();
if ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)){
document.write('<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/…" width="500" height="500">');
document.write('<param name="movie" value="movie.swf" /> </object> '); }
else{ document.write('<object data="movie.swf" type="application/x-shockwave-flash" width="500" height="500"></object>'); }
//]]>
</script>

<noscript>
<object data="movie.swf" type="application/x-shockwave-flash" width="500" height="500">
<param name="movie" value="movie.swf" /></object>
</noscript>

(Of course, now the future threat of Eolas/IE may force me to change how this code is delivered to the page.)

And when I need my Flash object to be 100% width and height, then I use this CSS selection in addition to the Javay:

<style type="text/css">
html,body {margin: 0; padding: 0; height: 100%;}
</style>

But in all fairness, perhaps the author of davidsonbicycles created the site long before this research was available. So, credit may be in order for cleverness. In the past, I have been bad at maintaining web standards in some of my site designs. I too have sinned.

It's also good that you are dead-set on maintaining web standards. Web developers/designers with such enthusiasm are few and far between. It's important that we continue to trade ideas and encourage each other in this important issue of XHTML compliance, because if we don't push it, then no one else will.