Re: [docbook-apps] How to add a Flash swf to a docbook xslt

From
Warren Young <>
Date
2008-12-08T17:38:34+00:00
ID
Thread
Re: [docbook-apps] How to add a Flash swf to a docbook xslt
 wrote:
> I don't think it is different than an svg as it is basically a
> vector graphic 

If we were designing HTML all over again today, maybe that's how we'd do 
it, but the reality of the situation is that it takes takes about 100 
lines of HTML and JavaScript code to reliably instantiate a swf file in 
a web page.  Adobe's tools generate all this for you when you create the 
.swf.  If you just have the raw .swf file, you can go steal the code 
from some page that includes .swf files.

There are several things making this more complex than it has to be.

First, as is so often the case, IE has different tags for loading swf 
files than the entire rest of the browser world.  IE wants you to use 
the <object> tag, while everything else uses <embed>.  So, you end up 
with JavaScript code to build the HTML for loading the swf, with two 
major forks in the logic: one way for IE, another for the rest of the 
world.  The generated HTML gets injected into the page at load time.

Second, you want to detect that the correct version of Flash is 
available.  If not, you have to generate some kind of fall-back HTML.

Third, the two steps above fail if you don't have JavaScript enabled, so 
you also have to have a <noscript> block to cover that case.  There are 
several options for what to do in the block, but it's something that has 
to be decided per-site.