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 scene::connectObject documentation for more information.
function onPresented()
{
    // Get the object box proxy that holds the ActiveX control.
    var box = scene.getBoxById("myObjectBox");
    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".
        scene.connectObject(box.control, "myFunc_", "js_test");
    }
}

//*********************************************************
// The ActiveX control in the object box has an event called "Click"
function myFunc_Click()
{
}

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