Adding the Scripting Code


For this sample, VBScript is used. First you must notify the browser which scripting language you intend to use, and then include the scripted commands in a comment. Put the SCRIPT tag anywhere in the BODY and embed the comment-surrounded code within the SCRIPT tags. The code will respond to events on the Web pages, such as clicking, and call methods on the NetShow RTP Audio control.


<SCRIPT LANGUAGE="VBScript">
<!--
Sub BtnAbout_OnClick
     call rtpaudio.AboutBox()
End Sub

Sub BtnPlay_OnClick
    call rtpaudio.Play()
End Sub

Sub BtnStop_OnClick
    call rtpaudio.Stop()
End Sub
-->
</SCRIPT>

Each subroutine is attached to a specific button that was defined in the FORM section. When a click event is triggered by a button being clicked, the code makes a call (or series of calls) to the audio control.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.