Java Reference
In-Depth Information
You can see that the classid attribute, listed as just ID, and the codebase attribute, listed as CodeBase,
are both displayed, although for codebase you may need to select the line and then scroll using the
arrow keys to see all the information.
From this information, you see that to insert a Flash ActiveX control in your web page you need to add
the following <object/> element:
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”
id=”flashPlayer1”
width=”500”
height=”100” />
You can also set attribute or parameter values for the control itself. For example, with Flash you need to
set the src attribute to point to the .swf fi le you want loaded, and you may also want to set the quality
attribute, which determines the quality of appearance of the Flash movie. However, to set the parameters
of the ActiveX control such as these (as opposed to the attributes of the <object/> element), you need
to insert the <param/> element between the start <object> tag and the close </object> tag.
In each <param/> element you need to specify the name of the parameter you want to set and the value
you want it set to. For example, if you want to set the src attribute to myFlashMovie.swf, you need to
add a <param/> element like this:
<param name=”src” value=”myFlashMovie.swf”>
Let's add this to the full <object/> element defi nition and also defi ne the quality attribute at the
same time.
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”
id=”flashPlayer1”
width=”500”
height=”100”>
<param name=”src” value=”myFlashMovie.swf”>
<param name=”quality” value=”high”>
</object>
Installing an ActiveX Control
You've seen how to insert an ActiveX control into your page, but what happens if the user doesn't have
that control installed on their computer?
This is where the codebase attribute of the <object/> element comes in. If the browser fi nds that the
ActiveX control is not installed on the user's computer, it will try to download and install the control
from the URL pointed to by the codebase attribute.
The creator of the ActiveX control will usually have a URL you can use as a value for the codebase
attribute. The information under the Internet Options option of the Tools menu you saw earlier provides
the codebase for the control that was installed on your computer, though this may not necessarily be the
best URL to use, particularly if it's not a link to the creator of the control.
Search WWH ::




Custom Search