activeXEventStringToObject

Convenience method that converts the value provided from ActiveX control events into an object.


Availability:

First available in version 3.5 build 314.

Available only in ActionScript 3.


Usage:

eventObject = StringUtils.activeXEventStringToObject(eventString)

eventObject - Object - A generic object that contains properties whose values match what is provided in the eventString.


Parameters:

eventString - String - The value returned to the event handler/callback function of an ActiveX.setNotify or ssEvents.addEventListener call.


Notes:

Data sent by an ActiveX event is always returned as a string. See ssCore.ActiveX.setNotify for more information about the format of the data returned. activeXEventStringToObject uses the name/value pairs that are returned as the property names and values of a generic object.


Examples:

This example is taken from ssCore.ActiveX.setNotify and shows how to trace an individual item.

import northcode.utils.StringUtils;

ssCore.init();
ssDefaults.synchronousCommands = true;

ssCore.ActiveX.createObject({object:"browser1", progId:"Shell.Explorer"});

ssCore.browser1.setNotify({event:"NavigateComplete2"}, {callback:onNavigateComplete2});

ssCore.browser1.setPosition({x:0, y:0});
ssCore.browser1.setSize({width:Stage.width, height:Stage.height});
ssCore.browser1.Navigate2({URL:"http://www.northcode.com"});
ssCore.browser1.setVisible({visible:true});

function onNavigateComplete2(ret_obj:Object, cb_obj:Object, err_obj:Object):void
{
    var evtObj:Object = StringUtils.activeXEventStringToObject(ret_obj.result);

    ssDebug.trace("object = "+evtObj.object);
    ssDebug.trace("event = "+evtObj.event);
    ssDebug.trace("pDisp = "+evtObj.pDisp);
    ssDebug.trace("URL = "+evtObj.URL);
}