Re: Incorporating Flash into a Website

> Here is a valid method, useful also for new issues in ie7 about swf 
> embedding.

It's not valid, because it violates the requirement that the document
be valid both before and after being manipulated by the scripting.
Normally this rule is violated by having documents that are only valid
if the scripting is run, of course.

Basically it is a trick to get round technical means of validation, not
a way of making the document valid.  However, the document can be made
valid if you supply your own DTD, one that does define the embed element.

> 
> 1) create a js called (for ex) foo.js
> 
> in the js write:
> 
> function RunIntro()
> {
>     document.write('<object 

This seriously stresses any scripting implementation because it either 
requires a stall in the reading of the HTML stream to allow the script
stream to catch up (typical browsers will read them on different 
connections), or requires a retrospective fix up, when the script
download completes.  I'd say it had a relatively high risk of finding
bugs - on the other hand, the code is essentially IE only, so maybe
it doesn't matter if other browsers get confused, as long as they ignore
the embed.  I don't believe any formal specification (except, maybe, 
ones associated with the, non-W3C, HTML 5 project) clearly specify the
sequencing constraints when scripts are used at load time but sourced
from a separate file.

Also, document.write without an explicitly opened target object is
deprecated and shouldn't be used with XHTML.  It's not supported by
the W3C document object model.

> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 

> height="670"></embed>\n');
> document.write('  </object>\n');
> }

This violates accessibility rules because there is no fallback content
if the browser cannot, or is not allowed to, render the flash content.

Generally, although I'd be surprised if the client accepted the argument,
it would be better to try to make the point that flash intros are like
bunting on used car lots; it indicates a third rank business.  A possibly
more effective argument is to point out that it will reduce search engine
ranking, because the home page will not have useful searchable content.

Received on Friday, 6 October 2006 06:40:30 UTC