method disconnectObject

bool disconnectObject(string prefix,string namespace);

Argumente

Zurückgegebener Wert

This method is used to disconnect an object function from active X events. See the box::connectObject documentation for more information.
function onPresented()
{
    // Get the object box proxy that holds the ActiveX control.
    var box = scene.getBoxById("myObjectBox");
    var otherBox = scene.getBoxById("otherBox");
    if (box)
    {
        // NOTE: If you call connectObject, you MUST call disconnectObject
        // to make sure you do not have any memory leaks.
        // I have imported some JavaScript with the id "js_test".
        otherBox.connectObject(box.control, "myFunc_", "js_test");
    }
}

function onClose()
{
    // Get the object box proxy that holds the ActiveX control.
    var box = scene.getBoxById("myObjectBox");
    var otherBox = scene.getBoxById("otherBox");
    if (box && otherBox)
    {
        otherBox.disconnectObject("myFunc_", "js_test");
    }
}