DAStatics Properties Relevant to DAModifiableBehavior Objects

ModifiableBehaviorFlags A read/write property whose value that represents the flags that define switching of DAModifiableBehavior objects.

ModifiableBehaviorFlags

DAStatics Class

A value that represents the flags that define switching of DAModifiableBehavior objects. The value can be one or more of the following:

DAContinueTimeline 0x001
Indicates that the time line of the behavior switched to will start at the beginning of the initial behavior's time line, not at the time of the switch. For example, if the initial behavior started at time t0, and the switch occurs at time ts, the switched-to behavior will behave as if it began at time t0 and has continued through to ts. If you switch to a reactive behavior with this flag set, events that might have altered the behavior between t0 and ts will have no effect.
DASwitchFinal 0x002
Indicates that this switch is final and the behavior won't switch again, so Microsoft® DirectAnimation® can perform optimization based on the fact that switching won't occur again.
DASwitchNextTick 0x004
Indicates that the switch should occur at the next tick. Typically, there is a tick with every new frame.

Note You can only use this function with DirectAnimation version 6.x or later.

Syntax

lib.ModifiableBehaviorFlags

Remarks

If the DAContinueTimeline flag is set, the first bit in the ModifiableBehaviorFlags will be one (binary 001, which is decimal 1). If the DASwitchFinal flag is set, the second bit in the ModifiableBehaviorFlags will be one (binary 010, which is decimal 2). If the DASwitchNextTick flag is set, the third bit in the ModifiableBehaviorFlags will be one (binary 100, which is decimal 4). Thus, if all the flags were set, the binary representation of ModifiableBehaviorFlags would be 111, which is decimal 7. If the DAContinueTimeline and DASwitchNextTick flags are set, the binary representation is 101, which is decimal 5.

The following code sets all the flags. The | operator is a bit-wise logical OR.

 m.ModifiableBehaviorFlags = m.ModifiableBehaviorFlags | (1 | 2 | 4);
 

The following code resets the DASwitchFinal flag to zero (so the flag is not set).

 // If the DASwitchFinal flag is set, reset it. The operator & performs 
 // a bit-wise logical AND.  The operator ~ is a logical NOT. Thus,
 // this code ANDs the existing flags with NOT DASwitchFinal. This
 // turns off the DAContinueTimeline flag and leaves the other bits
 // as they are.
 m.ModifiableBehaviorFlags = m.ModifiableBehaviorFlags & (~2); 

The following code checks to see if the DASwitchNextTick flag is set.

if (m.ModifiableBehaviorFlags & 4)
    // put code here to do something if the DASwitchNextTick
    // flag is set.

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