Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Question about Flash Detection


  • Please log in to reply

#1
Hitokage

Hitokage

    Member

  • Member
  • PipPip
  • 76 posts
I want to make a site but its got a flash menu. I've seen business pages do this... how do I have the viewer's computer checked for the flash to run the menu... so that it'll load the flash menu if the computer has it but loads a normal html menu if they don't?
  • 0

Advertisements


#2
sunny441

sunny441

    Member

  • Member
  • PipPipPip
  • 258 posts
hi there!!

the browser on the viewers comp automatically checks for flash plugin, and i don't think yu can do an autodetect - but yu can definitely set the Flash version as the default version of the page, and then provide a link that says -"click here for HTML or non-flash version" and link to the other page. ;)

easiest way to do it!

cheers!

:tazz:
  • 0

#3
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
This is oneway :

Providing alternative images

It is possible to determine (via Javascript) if the user has installed the Flash plug-in, and provide an alternative image if they have not. The following code is derived from code that was automatically generated by Flash 4. It is modified to merely trigger on the presence of the Flash plug-in.

Example:

<!-- Image Map -->
<MAP NAME="AK"></MAP>
<script LANGUAGE=JavaScript>
<!--
var UseFlash = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
// Check for Flash version 3 or greater in Netscape
var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=3
)
UseFlash = 1;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
// Assume any Windows IE except for Windows 3.1 supports the
// OBJECT tag UseFlash = 1;
}
if ( UseFlash ) {
// Use Flash player
// Although these alt tags do not apparently seem to be supported with the plug-in,
// they are included on the chance they are supported in an upgrade
document.write('<object width="400" height="400" alt="Object Map
of Alaska" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
document.write(' ');
document.write(' WIDTHU0 HEIGHT35
codebase="http://active.macrom...b#version=4,0,0 ,0"
id="AK">');
//
// the next 'document.write' line will need to be modified to point to your
// file and to use your params
//
document.write('<param name="movie" value="http://path/flashtem...
val2 "><PARAM
NAME=quality VALUE=high> <param name="bgcolor" value="#FFFFFF"> ');
//
// the next 'document.write' line will need to be modified to point to your
// file and to use your params
//
document.write('<EMBED ALT="Embed Map of Alaska"
src="http://path/flashtem...
<http://path/flashtem... " quality=high
bgcolor=#FFFFFF ');
document.write(' swLiveConnectúLSE WIDTHU0 HEIGHT35');
document.write(' TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedi...ex.cgi?P1_Prod_
Version=ShockwaveFlash">');
document.write('</EMBED>');
document.write('</OBJECT>');
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0
&& navigator.appVersion.indexOf("2.")>=0)) {
// Netscape 2 will display the IMG tag below so don't write an extra one
// You will need to modify the SRC param
document.write('<img src="http://path/flashtem...
val2<http://path/flashtem... " alt="GIF
Object Map of Alaska" WIDTHU0 HEIGHT35 border="0">
');
}
//-->
</SCRIPT>
// You will need to modify the SRC param as follows
<NOEMBED><IMG
SRC="http://path/flashtem...
<http://path/flashtem... "
ALT="NOEMBED GIF Object Map of Alaska" WIDTHU0 HEIGHT35 usemap="#AK"
BORDER=0></NOEMBED>
// You will need to modify the SRC param as follows
<NOSCRIPT><IMG
SRC="http://path/flashtem...
<http://path/flashtem... "
ALT="NOSCRIPT GIF Object Map of Alaska" WIDTHU0 HEIGHT35 usemap="#AK"
BORDER=0></NOSCRIPT>


Hope I didn't mistype anything, but probably did. :tazz:

Ron
  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Here's a neat online tool for generating the necessary code according to your parameters :

Generating HTML Code to View Flash

From site :

Generating HTML Code to View Flash

There are two questions that get asked of me the most: How do I publish a Flash animation? How can I make my animation transparent? After having spent more than 10 hours in Flash, I created a small program/animation that allows you to enter the various values for an animation. Best of all, after you enter your values for the movie, the HTML code gets generated automatically. Copy the HTML code into your Web page, and your animation will work.


Use the following animation to aid you in your goal of publishing an animation. The file is only 12k in size:



or you can use this with modifications :

<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macr...ersion=5,0,0,0" width="490" height="60" pluginspage="http://www.macromedi...hockwaveFlash">
<param name="movie" value="img/your_flash_file.swf">
<param name="quality" value="best">
<param name="wmode" value="transparent">
<param name="bgcolor" value="#ffffff">
</object>
</div>
This gets rid of the <embed> tags which the w3c.org has deprecated, it sets background to a transparent background and provides plugin info.

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP