API Examples

The examples below show how to perform different types of tasks with the Reflection for the Web API. You can cut and paste the sample code directly from the example page into a text editor, and then save the document with a .html extension.

If you store your web pages in the deploy folder that's created when you install Reflection, the examples should work with the codebase attribute set to ./ex. If you store your pages in a different folder, you'll need to first change the codebase attribute in the <applet> tag of the examples before they will work. Also, in examples that use the hostURL parameter to specify the name of a host computer, you should change the value to a host name appropriate to your network.

HINT:If the sample code is not formatted correctly after pasting it into your text editor, try reselecting the sample code, making sure that you extend your selection to the blank line after the end of the sample. Some browsers, such as Internet Explorer, do not copy all of the code formatting unless an ending paragraph mark is also selected. You can ensure that the paragraph mark is included in the selection by including the blank line after the last line of code.