Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Flash Detect
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Flash Detect

 Post Reply Post Reply Page  12>
Author
dmytton View Drop Down
Newbie
Newbie
Avatar

Joined: 28 November 2002
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmytton Quote  Post ReplyReply Direct Link To This Post Topic: Flash Detect
    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?
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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 - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
dmytton View Drop Down
Newbie
Newbie
Avatar

Joined: 28 November 2002
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmytton Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 12 February 2003 at 12:03pm
how the javascript do it?
Back to Top
dmytton View Drop Down
Newbie
Newbie
Avatar

Joined: 28 November 2002
Location: United Kingdom
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote dmytton Quote  Post ReplyReply Direct Link To This Post 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 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>

Back to Top
faubo View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post 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 www.aspin.com and those other asp sites?



Edited by faubo
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post 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 - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
gupta_ji View Drop Down
Groupie
Groupie
Avatar

Joined: 29 October 2003
Location: India
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote gupta_ji Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 9:10am

no flash knowledge

 

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.