Adding Events to an Enhancement Stream

[This is preliminary documentation and subject to change.]

An enhancement stream comprises a set of events that occur during the show that is interactive. You create or extend a stream by adding events to it. These events can be represented either by lines of stream compiler syntax or by EnhEvent objects.

If you are writing a stream authoring tool, you can use the stream compiler objects to create the stream. Using these objects, the enhancement stream is saved to a text file in the stream compiler language. An alternative to using the stream compiler objects is to create and edit a text file containing lines of stream compiler languages. Because the stream compiler objects already implement much of the functionality required to create and save an enhancement stream, it is recommended that you use them to build your authoring tools.

Using the stream compiler objects, you can add events to the enhancement stream by calling either the EnhEvents.AddText or EnhEvents.Add method. Both methods create a new EnhEvent object and add it to the stream, as represented by an EnhEvents collection.

The methods differ, however, in how they initialize the new EnhEvent object. EnhEvents.AddText initializes the event using the stream compiler syntax specified when AddText is called, whereas EnhEvents.Add initializes the event using a specified starting time and EnhEvent.Name property value.

The following example demonstrates adding events to the stream using EnhEvents.AddText and EnhEvents.Add.

Dim evs as IEnhEvents
Dim e As IEnhEvent
Set evs = New EnhEvents
 
'Use AddText to add an event that downloads File1.htm thirty seconds
'after the show starts.
evs.AddText("30.0 ""File1.htm"";")
 
'Use Add to add an event that downloads File2.htm sixty seconds after
'the show starts. 
evs.Add 60, "File2.htm"