AppTriggeredEvent Class

Creates the event. The event can be used in the until and untilNotify methods to create reactive behaviors based on external events.

In the following example, a cube turns from red to blue, based upon some external application event:

//Turn a cube from red to blue when an external event occurs.
//The following code is a fragment from a larger program.
//Get the cube.
GeometryBvr cube = importGeometry(buildURL(geobase, "cube.x");

//Create the external event.
AppTriggeredEvent appEvent = new AppTriggeredEvent();

//Set up the color of the cube -- red until the event, then blue.
ColorBvr col = (ColorBvr)until(red, appEvent, blue);

//Map the color to all points of the cube.
GeometryBvr coloredCube = cube.diffuseColor(col);

//...elsewhere, when the application receives the event...
appEvent.trigger();

//...now coloredCube (assuming it's running) will turn blue.

AppTriggeredEvent Methods

trigger() Triggers the event.
trigger(eventData) Triggers the event and passes the given data to the event handler or notifier.

trigger()

AppTriggeredEvent Class

Triggers the event.

Syntax

public void trigger( );

Remarks

The triggered event occurs as soon as possible.

trigger(eventData)

AppTriggeredEvent Class

Triggers the event and passes the given data to the event handler or notifier.

Syntax

public void trigger( Behavior eventData );

Parameters

eventData
Object that contains any data representing the event.

Remarks

The triggered event occurs as soon as possible.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.