Multiuser Lingo Dictionary > Multiuser Lingo Dictionary > call() |  |

call()

Syntax

    whichThread.call(#whichHandler, targetObject, arg1, arg2 ...)

Description

Multiuser Server server-side command; calls a handler in the `targetObject` parameter in `whichThread`. The current thread continues execution while the handler `whichHandler` is called in the script object `targetObject`.

Threads may also pass values between themselves using shared objects and the `lock()` and `unlock()` commands to ensure data integrity within the shared objects.

Arguments required by the handler being called should be passed after the `targetObject` parameter.

When used in threads, the `call()` command should only be used to call the specified handler in a single target object at a time. Using lists of target objects, or using `call()` more than once in the same thread before the first one has completed can produce unpredictable results. It is recommended that separate simultaneous calls to handlers be done in separate threads. This is different from the `call()` command in the Director authoring and playback environments, where it can take a list of target objects.

Example

The following server-side statements assign the integer 55 to the variable `startValue` and then pass that value to the `on MultiplyValue` handler and run the handler in the thread `testThread`. The `me` object indicates that the handler is located in the same script object that contains these statements:

    startValue = 55
    testThread.call(#multiplyValue, me, startValue)

See also

`produceValue()`, `awaitValue()`, `lock()`, `unlock()`