Share via


Calling Functions

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

If you need to call more than a few lines of code, you can load a script file using the scriptFile attribute of the VIEW element, and call the functions in the script. You can load more than one file per view:

scriptFile = "myfile1.js;myfile2.js;myfile3.js"

After the script files are loaded, you can call functions in them from inside your View section. For example, to call a function called myfunction when something is clicked, type the following:

onclick = "JScript: myfunction()"

Note

If you have more than one view, only the functions in files loaded into the current view are available to the XML and JScript code running with the current view. Files loaded in other views are not in scope with the current view.

 

Using JScript