Detecting Flash Player 8 on a cfform
6 comments Posted by: NahuelNow that we are using some features of the flash player 8 such as file upload, we need detect whether the user has it installed in his/her computer. Macromedia has recently published an article on DevNet that explains how to implement a detection script and new feature called "Flash Player Express Install", which greatly simplifies the flash install. To be honest, I didn't read the article, but instead, I made a small script that checks for the flash 8 inside the cfform.
<cfsavecontent variable="checkVersion">
var version = getVersion();
var versionNumber = Number(version.substr(4,1));
if(versionNumber < 8)
{
//If the player is not version 8 or above, do something, such as showing an alert
var msg = '<p>This example requires Flash Player 8 <font color="#0000ff"><a href="http://www.macromedia.com/software/flashplayer/public_beta/">You can download it here</a></font></p>'
var alertSettings:Object = {title:'Warning', message: msg, width:200, headerHeight:27 }
//remember that this way of showing an alert may break in future versions of CF, but it is the only way to embed html in it
errorpopup = mx.managers.PopUpManager.createPopUp(this, FormErrorException, true, alertSettings);
errorpopup.centerPopUp(this);
}
</cfsavecontent>
You can call this script whenever you want, I updated our previous example so now it checks for the latest player
You can view the updated version
Category: CFForm | ColdFusion |
6 Comments so far
Write yoursUsing this line: version.substr(4,1)
Once flash player gets above flash 9, that will fail to work.
You may want to try an alternate method, like <a href="http://blog.deconcept.com/flashobject/">FlashObject</a>.
Check this file out:
WEB-INF\cfform\flex-config.xml
About halfway down the page there is the following code:
<flash-player>
- <!-- enable/disable player detection
-->
<enable>true</enable>
- <!-- require 7.0.14
-->
- <!-- required player version
-->
<required-version>7</required-version>
- <!-- 'dot' release of the required player
-->
<required-major-revision>0</required-major-revision>
- <!-- minor revision number of the required player
-->
<required-minor-revision>14</required-minor-revision>
- <!-- auto-install the player on windows and ie-only
-->
- <!--
When windows-auto-install is true, IE will attempt to download the ActiveX player without
user intervention. When false, the user is directed to the download url for upgrade.
-->
<windows-auto-install>true</windows-auto-install>
- <!-- player upgrade page - users without the required Flash version will be directed here
-->
<download-url>{context.root}/cfform-internal/detection-kit/upgrade_flash/upgrade_flash.html</download-url>
<download-https-url>{context.root}/cfform-internal/secure/detection-kit/upgrade_flash/upgrade_flash.html</download-https-url>
- <!-- activex upgrade page - the location for downloading the ActiveX player
-->
<activex-download-url>http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab</activex-download-url>
<activex-download-https-url>https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab</activex-download-https-url>
- <!-- plugin upgrade page - the location for downloading the Plugin version of the player
-->
<plugin-download-url>http://www.macromedia.com/go/getflashplayer</plugin-download-url>
<plugin-download-https-url>https://www.macromedia.com/go/getflashplayer</plugin-download-https-url>
</flash-player>
I'm thinking that changing this code to look for Flash 8 will work. I haven't tried it becuase I think Flash 8 is too buggy for my tastes. If anyone else gets this to work let me know.
That line of code has nothing to do with the actual plugin detection. It is only there to set some properties of the popup window.
I've an html file which is puplished in flash player 9..
If i test in few pc i am not able play the file.It gives me a black html with the image icon..(X) so i need "auto instilling script for flash player" can i use this script.. i don't have any idea on this ..