Flash version detect

I am trying to get around using java script in the html of the site.

I found this script , is it possible to adapt this, see below?

‘This script will detect which version of the player a user is using and redirect to an appropriate page. This script checks for the first decent build of the v6 player build 29. Just change the anmes of the destination files and paste this script in the very first frame of your swf.’

version= getVersion(); space=version.indexOf" “); myString=version.substring(space+1,version.lemgth); myArray=myString.split(”,"); player= new Object(); player.platform=version.substring 0,space); player.majorVersion=parseInt(myArray[0]); player.minorVersion=parseInt(myArray[1]); player.buildNo=parseInt(myArray[2]); player.patchNo=parseInt(myArray[3]); if (player.majorVersion==6) && (player.buildNo >= 29){ getURL(“myversion6page.html”); }else{ getURL(“myotherpage.html”); }


How about having a plain flash 5 version SWF loading up first, in the same position in the html with this code in it:

version= getVersion(); space=version.indexOf" “); myString=version.substring(space+1,version.lemgth); myArray=myString.split(”,"); player= new Object(); player.platform=version.substring 0,space); player.majorVersion=parseInt(myArray[0]); player.minorVersion=parseInt(myArray[1]); player.buildNo=parseInt(myArray[2]); player.patchNo=parseInt(myArray[3]); if (player.majorVersion==6) && (player.buildNo >= 29)

And instead of having this :

{ getURL(“myversion6page.html”); }else{ getURL(“myotherpage.html”); }

could the Flash 5 file do either the following depending on which flash player is detected:

  1. Have the Flash 5 swf display the text ‘You need to update your Flash player’ and open up the macromedia download page in a new window.

  2. If the Flash 6 player is detected, have it load the Flash 6 that was originally intended to be in that place of the html.

Would appreciate it if you could help

Thanks

I don’t know how/if it can be done, but here is a questions…

If you are testing if they have your version of flash… why would you put it in your flash movie? If they don’t have your version of Flash, then they wouldn’t be able to see the movie and wouldn’t recieve the notice saying they don’t have that version.

So it makes more sense to do it in Javascript rather than having 2 swf movies.