GOAL: Use a NetShow video stream to fire off Macromedia Flash animation events in another frame on the page.

To do this, we use the Flash ActiveX control, available from http://active.macromedia.com/flash2, some script to direct the events to the NetShow control, and the NetShow ActiveX control.

CODE TO PUT IN YOUR HTML: We have set up this example using frames. The right-hand frame called SWFLASH.HTM simply contains the Flash ActiveX control:

Note that in this Flash control, we use codebase to automatically install the Flash player on computers without Flash, or with older versions of it.

In the left-hand frame called NetShow.htm, we have some JavaScript code and the NetShow ActiveX control. This JavaScript function is used to receive and interpret the events and parameters being sent from the NetShow stream. NSPlay1 refers to the NetShow Player control. This segment of code should come after the <TITLE> tag in your HTML.

This says that if the NetShow control sends an event (scType) called text, to plug the parameter it sends with it (ScCmd) into the function, which triggers different actions based on the ScCmd type being sent at that time. For example, if the event is Text and the parameter is start then the subroutine called will execute the command parent.swflash.SWFlash.Play() which will start the Flash animation playing. Remember that this won't work unless your ASF stream contains these events and parameters in them.

Next, you need the NetShow control in the page. Here's the code we used:

Next, you'll need to add the events and parameters to the NetShow stream.

EVENTS AND PARAMETERS TO PUT IN YOUR NETSHOW STREAM: The preceding subroutine will wait for events and parameters from the NetShow stream to be sent to it before it will do anything. In this example, here are the events and parameters we used:

For more information about using Flash, see the Macromedia Flash Web site.


© 1998 Microsoft Corporation. All rights reserved.