DirectAnimation Animated Header --DAEvent Class DirectAnimation Animated Header --DAEvent Class* Microsoft DirectAnimation SDK
*Contents  *Index  *Topic Contents
*Previous Topic: DAEndStyle Class
*Next Topic: DAFontStyle Class

DAEvent Class


Creates a DAEvent object that represents an event. Events identify specific times, states or user actions and are used to specify when given actions should occur. Typically, you use events with the Until and UntilEx functions (in the DAStatics class) to create behaviors that change as a result of the event. For example, you can change the color of an object when the user presses a mouse button by using the LeftButtonDown property and the UntilEx function. Every event, when it occurs, returns some event data. This data may or may not be meaningful, depending on the event. For example, LeftButtonDown does not return any meaningful data.

You can combine existing events to create new, more complex events. For example, the AndEvent function in DAStatics lets you combine two events so that the resulting event occurs only if both of the original events occurred simultaneously. The data produced by an event can only be examined within the notifier.

DAEvent Functions

bullet1.gifAttachData

bullet1.gifNotify

bullet1.gifScriptCallback

bullet1.gifSnapshot


AttachData

DAEvent Class

Takes a DABehavior object and produces a new event. The new event occurs at the same time as the original event, but its data is now the data that was specified in the call to AttachData. This allows an application to associate arbitrary client data with an event and know that it will be delivered to the notifier when the event occurs.

eventObj.AttachData(
  data
  )

Parameters
data
The DABehavior object.
Return Values

Returns a DAEvent object. The event data is the event data of the new event.

See Also

DAUserData


Notify

DAEvent Class

Creates a new event. This occurs when the original event occurs. It then calls the notifier and uses the result as its event data.

eventObj.Notify(
  notifier
  )

Parameters
notifier
Returns the new behavior.
Return Values

Returns the DAEvent object. The event data is the time the event fired and the new behavior.


ScriptCallback

DAEvent Class

Invokes VBScript or JScript functions from within animations.

eventObj.ScriptCallback(
  function,
  language
  )

Parameters
function
The function (a string) to be called.
language
The name (a string) of the scripting language.
Return Values

Returns a DAEvent object. When this event occurs, the data it produces has a trivial value.


Snapshot

DAEvent Class

When called on an instance of a behavior, samples the given behavior and returns it as a constant behavior with the value as data. The event time of the new event is when the original event occurs.

eventObj.Snapshot(
  a
  )

Parameters
a
The DABehavior object which will be sampled when the function is invoked.
Return Values

Returns the DAEvent object. The event data is the value of the behavior at the time it was sampled, returned as a constant behavior.

Relevant Functions from the DAStatics Class

The following functions are defined in the DAStatics class and are most relevant to objects of type DAEvent.

lib.AndEvent(first, second)

lib.KeyDown(keyCode)

lib.KeyUp(keyCode)

lib.NotEvent(ev)

lib.OrEvent(first, second)

lib.Predicate(bool)

lib.ThenEvent(e1, e2)

lib.TimerAnim(timeout)

lib.Timer(timeout)

Relevant Properties from the DAStatics Class

The following properties are defined in the DAStatics class and are most relevant to objects of type DAEvent.

lib.Always

lib.LeftButtonDown

lib.LeftButtonUp

lib.Never

lib.RightButtonDown

lib.RightButtonUp

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

*Top of Page