Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: OT: vbscript in Moock detect for Flash
From: Helen Triolo
Date: Sat, 16 Dec 2000 18:23:18 GMT

I'm using Moock's detection script for a page with Flash in a table cell
(replaced with a gif if no flash) and it works fine. But his script has
more in it than I need, so I'm trying to simplify it and ran into a
problem with the section that writes vbscript (inside a javascript
routine) for detection in IE. Here is a piece of code that works fine
(no error generated, but it's not doing anything useful -- it was just a
test):

<.SCRIPT LANGUAGE="JavaScript1.1" type="text/javascript">
<!--
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true :
false;
//alert('inside first js routine');
if(isIE && isWin) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write(' pluginVersion = 5 \n');
document.write('</SCR' + 'IPT\> \n');
}
// -->
<./SCRIPT>

and here is a piece of code that generates an error ("statement
expected") when the next javascript section immediately following is
reached:

<.SCRIPT LANGUAGE="JavaScript1.1" type="text/javascript">
<!--
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true :
false;
//alert('inside first js routine');
if(isIE && isWin) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('if
IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")) then \n');
document.write(' pluginVersion = 3 \n');
document.write('endif \n');
document.write('</SCR' + 'IPT\> \n'); /
}
// -->
<./SCRIPT>

I also tried breaking up the if and endif statements into pieces like
the script tags, in case the if was being read out of context, but it
didn't help. Can anyone see an obvious (or not obvious) reason why this
code generates an error on the line following the final closing script
tag? In both instances, the variable "pluginVersion" is defined
globally in a js script section preceding this one. (Not sure how it is
that vbscript sets a variable defined in javascript, but it does seem to
work with the flash4installed etc variables in the original script, so I
don't think that's the problem). And I added the dots in the script
tags here so this email would be readable (I hope).

Regards,
Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: OT: vbscript in Moock detect , Muzak

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]