A behavior to control a sprite with an activeX-control in it in a way that works without hardcoded Sprite numbers.
activeX control

This Behavior controls a sprite with an activeX control.

In this example, a comboBox is used. That Control is named 
Microsoft Forms 2.0 ComboBox and should be registered already on a typical 
Win32 if at least the MSIE 3.0 has been installed. 
It would work with a custom activeX-control build in VB analogous.

I cut this from a running project so there may be some pecularities 
left which made sense in the original context but seem superfluous now.

A flaw of sprites with ax-controls in it is that they are not really behavior 
aware. You talk to the ax-control via sprite properties and methods and it will 
answer sending event-messages to the behavior, but w/o the me -reference to 
the sprite object. 
This means that event handlers which connect control-events have per se 
no contact to behavior-properties (which are properties of the sprite object).

This behavior tries to get around that by use of

- an unique identifier _hardcoded_ into the scripttext ( getMyself() )
- an external propertyList (or Object) which stores [#uniqId:<objRef>] - pairs 
  of every single control.
- a method getme() which supplies the needed reference via a lookup in that 
  external List for the hardcoded ID

There are another two external movie script handlers which this behavior 
expects to be there:

- a method to obtain a List of ID:displyText pairs to allow to select from
- a callBack to tell of comboBox events

Besides, there is a handler in the moviescript which allows another somewhat 
to poll for the current choice of the comboBox.
put getCurrentEntryofControlID (#comboBoxBeh)
-- ["beo", #b]

You may copy and use and change this example as you like, just leave my 
name somewhere in the comment, thanks

Daniel Plaenitz, Berlin, November 1999

download the file as zip 

Two sources of fine info on the matter are at:

updatestage 970901
updatestage 980701

Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact