This class allows Microsoft® DirectAnimation® behaviors to be attached to (and detached from) properties in Microsoft ActiveX® controls. For example, a NumberBvr can be attached to the width property of a frame on an HTML page.
PropertyDispatcher Methods
detach Detaches an already attached behavior from an ActiveX control property. getBvr Retrieves a behavior that, while it is the same as the behavior used in the constructor, is updated over time. PropertyDispatcher Constructs a PropertyDispatcher object. setControl Sets the ActiveX control object to which a behavior will be attached. setPropertyName Sets the name of the ActiveX control property to which a DirectAnimation behavior will be attached.
Detaches an already attached behavior from an ActiveX control property.
Syntax
public void detach( );
Retrieves a behavior that, while it is the same as the behavior used in the constructor, is updated over time. This is the behavior that should be used once the PropertyDispatcher object has been constructed.
Syntax
public Behavior getBvr( );
Return Value
Returns the Behavior object.
Constructs a PropertyDispatcher object.
Syntax
public PropertyDispatcher( Behavior a );
Parameters
- a
- Behavior to be attached to an ActiveX control property.
Remarks
The behavior specified by a is used only in the constructor. To attach a behavior to a property, first create the PropertyDispatcher class with that behavior, and then extract an equivalent behavior with getBvr(). Use this behavior in the model. When access to the control and its property name is available, call setControl() and setPropertyName(). Here is an example:
NumberBvr n = the behavior that will be attached to a control PropertyDispatcher pd = new PropertyDispatcher(n); NumberBvr attachedN = (NumberBvr)pd.getBvr(); //...At some other point pd.setControl(ctrl); pd.setPropertyName("width");Note that the attachedN behavior must be running to affect the attached property. The behavior is running if:
- It is part of the image or sound registered with setImage() or setSound() on the model.
- It was explicitly added to a BvrsToRun list.
Sets the ActiveX control object to which a behavior will be attached.
Syntax
public void setControl( Object object );
Parameters
- object
- ActiveX control object to which a behavior will be attached.
Sets the name of the ActiveX control property to which a DirectAnimation behavior will be attached.
Syntax
public void setPropertyName( String name );
Parameters
- name
- Name of the property to which a DirectAnimation behavior will be attached.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.