
Using ActiveX controls
205
4
Set the values for each property in the ActiveX control and then click OK. The ActiveX control
now appears in the cast.
5
Drag the ActiveX control from the cast to the Stage.
Once the ActiveX control appears on the Stage, it can be repositioned and resized just like any
other sprite Xtra. When you pause the movie, the ActiveX control stays in authoring mode
and does not react to mouse or keyboard events. When you play the movie, the control
responds to user input.
Setting ActiveX control properties
An ActiveX control describes its information using properties—named characteristics or values
such as color, text, font, and so on. Properties can include not only visual aspects but also
behavioral ones. For example, a button might have a property that indicates whether the button is
momentary or push-on/push-off. An ActiveX control’s properties define its state—some or all of
which properties may persist. Although the control can change its own properties, it is also
possible that the container holding the control might change a property, in response to which the
control would change its state, user interface, and so on.
When an ActiveX control is inserted into a Director movie, the properties that the control exposes
can be viewed and edited by clicking the Properties tab of the Control Properties dialog box for
the ActiveX Xtra. Each property exported by the ActiveX control is identified along with the
current value of the property. The user edits a property value by simply clicking over the existing
value with the mouse. For most properties, such as numeric or string values, the new value can be
directly entered into the list using the keyboard.
In Director, all properties that an ActiveX control exports are properties of the corresponding
sprite. This is the generic syntax for setting an ActiveX control property:
sprite(X).propertyName = value
The generic syntax for getting an ActiveX control property is as follows:
value = sprite(X).propertyName
As an example, if the Microsoft Access Calendar control is inserted into a Director movie as the
second sprite on the score, the following script sets the Year property of the Calendar control to a
specific year:
sprite(2).year = 1995
To get the Year property from the same Calendar control and place it into a variable named
CalendarYear
, you can use the following script:
CalendarYear = sprite(2).year
Some ActiveX control properties are read-only, and trying to set a property for such a control
causes an error in Director. For more information, see the documentation for the ActiveX control
you are using.
Using ActiveX control methods
An ActiveX control describes its functionality using methods. Methods are simply functions
implemented in the control that Director can call to perform some action. For example, an edit or
other text-oriented control supports methods that let Director retrieve or modify the current text,
perhaps performing such operations as copy and paste.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...