Java Reference
In-Depth Information
For Flash, the codebase is http://fpdownload.macromedia.com/get/shockwave/cabs/flash/
swflash.cab, so your <object> tag will look like this:
<object classid=”clsid:D27CDB6E-AE6D-11CF-96B8-444553540000”
codebase=”http://fpdownload.macromedia.com/get/shockwave/cabs/flash/swflash.cab”
id=”flashPlayer1”
width=”500”
height=”100”>
<param name=”src” value=”myFlashMovie.swf”>
<param name=”quality” value=”high”>
</object>
Subject to license agreements, you may be able to download the .cab fi le that installs the control to
your own server and point the codebase attribute to that.
Unfortunately, there is no easy foolproof way of checking which ActiveX controls are installed on the
user's computer. However, the Object object of the <object/> element does have the readyState
property. This returns 0, 1, 2, 3, or 4, indicating the object's operational status. The possible values are
as follows:
0
— Control is un-initialized and not ready for use
— Control is still loading
1
2
— Control has fi nished loading its data
— User can interact with control even though it is not fully loaded
3
4
— Control is loaded and ready for use
You need to give the control time to load before checking its readyState property, so any checking is
best left until the window's onload event handler or even the document object's onreadystatechange
event handler fi res.
To redirect the user to another page that doesn't need the control, you need to write this:
function window_onload() {
var flashPlayer1;
// code to retrieve ActiveX plug-in
if (flashPlayer1.readyState == 0)
{
window.location.replace(“NoControlPage.htm”);
}
}
onload = window_onload;
This code checks to see if the ActiveX control's readyState is 0. Since this code executes after the
browser loads the page, it's safe to assume the ActiveX control isn't installed on the computer.
Search WWH ::




Custom Search