Inserting Flash - Why JavaScript?

T

Tony

When I insert Flash with FrontPage 2002, it creates the standard <OBJECT></OBJECT> HTML
code as you would expect.

But I've seen some webpages where the Flash HTML code is written using JavaScript, as
in:

<script language="javascript">
var FlashPage
FlashPage =("<OB"+"JECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
FlashPage
+=("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#versio
n=6,0,79,0' ");
_page +=("WIDTH='" +_theW+ "' HEIGHT='" +_theH+ "' ID='flashobjectswf' ALIGN=''> ");

and etc...

Clearly there's some advantage to breaking up the word OBJECT above and writing it out
as "<OB"+"JECT ..., but I don't know why?

What is the advantage of writing the Flash HTML out using JavaScript?

Thanks!!!
 
M

Mike Mueller

The javascript is most likely used to deteremine the browser type and write
the appropriate code based on that.

The classid tells IE which ActiveX componenet to use, but other platforms
(browsers or OS) do not use ActiveX so the classid info is useless to them.
Many browsers support the non-standard <embed> tag created by Netscape, but
IE does not.
Another method used for non-IE systems is to use the mime-type information
inside of an object tag.
 
T

Tony

The javascript is most likely used to deteremine the browser type and write
the appropriate code based on that.

Then why have this line of JavaScript:
FlashPage =("<OB"+"JECT etc...

Why break up the spelling out <OBJECT...

???
The classid tells IE which ActiveX componenet to use, but other platforms
(browsers or OS) do not use ActiveX so the classid info is useless to them.
Many browsers support the non-standard <embed> tag created by Netscape, but
IE does not.
Another method used for non-IE systems is to use the mime-type information
inside of an object tag.

Isn't that why all Flash tags use both <OBJECT> and <EMBED>.already?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top