Forum Moderators: open

Message Too Old, No Replies

Flash Satay vs Javascript

Making flash XHTML Compliant

         

twist

8:34 pm on Mar 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have discussed this in the past but have found some new information that I would like some input on.

The Flash Satay Method has some upsides but has a few downsides.

The workaround is simple: just include one sacrificial movie at the front of your site with the codebase attribute left in. This needs to be a movie with no purpose within the site—just a 1k empty blob of nothingness that causes the user to be prompted if they have an old version of the plug in. Not the cleanest approach, but a practical one. It shouldn’t lose you any friends.

What if a person doesn't enter through the homepage. Also could be confusing if a person is asked to download flash when their is no flash, that they can see, on the page. This is somewhat irrelivant since you could just include "codebase" on each flash page, but then you lose the part of the idea behind the satay method, keeping the code small.

The container movie

A workaround for a problem but this usually, from what I have read, is the beginning of issues when using different browsers and versions of flash. It seems other rare issues have arised from using the Satay Method.

---

Reasons for using the standard flash <embed> and <object> tags. They work, always. If a browser, lets say IE7, were released that no longer worked correctly using the flash <embed> and <object> tags then tens of thousands of websites would break. So basically, support for the current <embed> and <object> tags is going to be around for quite some time. So using these tags seems to be the safest way to go. The problem is XHTML compliance.

When playing around with the google maps API, I see they use "CDATA" around their javascript, so I looked it up since I wasn't sure what it did,

http://www.w3schools.com/xml/xml_cdata.asp

All text in an XML document will be parsed by the parser.
Only text inside a CDATA section will be ignored by the parser.

I tried it and it worked without issue. I understand that this doesn't make my page XHTML compliant, but the only reason I want my pages to be XHTML compliant in the first place is to catch coding errors. Using this allows me to add flash that will work without issue while still being able to check my pages for errors with the validator.

Another advantage of using javascript to deliver the code is the ability to use multiple flash files on the same page without creating any extra code by putting the flash in a javascript function that you can call multiple times.

I am not looking for a argument, just a discussion on the upside and downside of either method to deliver flash content without compliance errors. I never really see the javascript option discussed, from looking through the forum it seems most people are only told about the Satay Method.

The basic setup for anyone interested,

<script type="text/javascript">
//<![CDATA[
...flash code here
//]]>
</script>

encyclo

2:39 am on Mar 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I should start by saying that I use very little Flash (and I don't even have the plugin on my main machine), but in my very limited experience the Satay method is flawed in that it fails in several circumstances, and it is hampered by the fact that it reduces compatibility to unnecessarily enforce a certain compliance with standards. I would use the old-fashioned invalid method and live with the errors, personally, as the errors are related to unknown elements/attributes (basically harmless) rather than ill-formed markup.

Using Javascript to insert the code is an option - in reality you are obfuscating otherwise invalid code to pass validation, but as you say it can have the advantage of being more reuseable. In your situation, I would say that it is a good choice.