Print Page | Close Window

Flash Detect

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=102
Printed Date: 31 March 2026 at 4:39pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Flash Detect
Posted By: dmytton
Subject: Flash Detect
Date Posted: 12 February 2003 at 11:32am
I am designing a site which has a flash menu system. I want to be able to use ASP to detect if the user has flash. If so, then the flash menu is used (using includes) and if not, then an image version is displayed (using includes). Anyone know how to go about doing this?



Replies:
Posted By: Scotty32
Date Posted: 12 February 2003 at 11:38am

id also like to know this... not for links but for an intro

i found a lil thing in the IIS, but cant remember if it had a Flash detecter... and it didnt seem to work well in Netscape or Opera



-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: dmytton
Date Posted: 12 February 2003 at 11:39am
I have a java script to do it but I don't think that will allow me to tell the asp page which menu to use.


Posted By: faubo
Date Posted: 12 February 2003 at 12:03pm
how the javascript do it?

-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: dmytton
Date Posted: 12 February 2003 at 12:16pm

<script language="javascript">
<!-- Hide script from old browsers
var expireDate = new Date  
var hasFlash = false           
var numVisits = 0           
var skipFlashURL = "noflash.html"                
//Sets the browser cookie

function setCookie(){

expireDate.setMonth(expireDate.getMonth() + 6)

document.cookie = "numVisits=" + 0 + "; expires=" + expireDate.toGMTString()

 }

//Check for flash if browser is netscape
//submitted to http://www.a1javascripts.com - www.a1javascripts.com by Joshua Luft-Glidden
if(navigator.appName == "Netscape"){

for(i=0; i<navigator.plugins.length; i++){

if(navigator.plugins[i].name == "Shockwave Flash"){

hasFlash = true

 }

}

}

//Check for flash if browser is IE

else if(navigator.appName == "Microsoft Internet Explorer"){

document.writeln("<script language='VBscript'>")
document.writeln('\'Test to see if VBScripting works')
document.writeln("detectableWithVB = False")
document.writeln("If ScriptEngineMajorVersion >= 2 then")
document.writeln("   detectableWithVB = True")
document.writeln("End If")
document.writeln('\'This will check for the plugin')
document.writeln("Function detectActiveXControl(activeXControlName)")
document.writeln("   on error resume next")
document.writeln("   detectActiveXControl = False")
document.writeln("   If detectableWithVB Then")
document.writeln("      detectActiveXControl = IsObject(CreateObject(activeXControlName))")
document.writeln("   End If")
document.writeln("End Function")
document.writeln("</scr" + "ipt>")
hasFlash = detectActiveXControl("ShockwaveFlash.ShockwaveFlash.1")

 }    

//If there is no cookie (first time visitor) set one

if(document.cookie == ""){
setCookie()
 }
//If there is a cookie (visitor has been here before) update cookie

 else{

var dummy = document.cookie.split("=")

numVisits = dummy[1]
expireDate.setMonth(expireDate.getMonth() + 6)
document.cookie = "numVisits=" + ++numVisits + "; expires=" + expireDate.toGMTString()

 }
//If visitor has been to the site many times skip flash intro

if((document.cookie != "") && (numVisits > 5) && hasFlash){

document.location = skipFlashURL

 }
//If visitor doesn't have flash skip intro

if(!hasFlash){

document.location = skipFlashURL

}
//End script hiding -->

</script>



Posted By: faubo
Date Posted: 13 February 2003 at 11:05am

If they have flash send them to your homepage, if not, send to anoter asp page eg. noflash.asp

in the noflash.asp you create a session where you tell that "no flash" is enabled (true or anything else you want) and then redirect them to your homepage.

Then

In your home page and all the others (use a include for that) you check if the session that you create is true. If is you use the images menu, if not you use the flash one.

This means that your flash users will go straight to your homepage without the menu session set to true and then they would get the flash menu.

The non-flash users will go to the nonflash.asp where you will create the menu session, set it to true and redirect them to your home page.

That's it, you have separate your two kinds of users and in each page this will mean what menu they will get.

 

but you can probably find out who have flash with asp, did you search in http://www.aspin.com - www.aspin.com and those other asp sites?



-------------
http://www.conhecerparaconservar.org - I don't know how to make you click here


Posted By: Scotty32
Date Posted: 14 February 2003 at 5:08am
couldnt ya like if they dont have flash send em to a page like "index.asp?flash=no" and put "if flash = "no" then show images" etc

-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: gupta_ji
Date Posted: 30 October 2003 at 9:10am

no flash knowledge

 



-------------
http://www.sgrj.com" rel="nofollow - chartered accountants India , http://www.delhiprofessionals.com" rel="nofollow - accounting Outsourcing ISO Certification


Posted By: WebWiz-Bruce
Date Posted: 30 October 2003 at 9:27am
What I use, incase JavaScript is disabled was to simply make a flash file that rediercts the user to another page, that way if the user has Flash they are redircte as the file will run if not they stay on the same page, or use a meta refrseh to send them somewhere else.

Nice and simple.

Here is an example from something I worked on about 5 or 6 years ago:-

http://www.europeancarcentre.co.uk - www.europeancarcentre.co.uk


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net