ssCore.ActiveX.callMethod

Call a method on an ActiveX object.


Availability:

First available in version 3.3 build 120.


Input Parameters:

object - The name of the ActiveX object used in the call to createObject.

method - The name of the method to call.


Output Parameters:

result - Returns the value of the method call (if any).


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.ActiveX.callMethod( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.ActiveX.callMethod( paramsObject );


Notes:

The Input Parameters section above only contains two parameters, the name of the ActiveX object you want to call and the name of the method you want to call on that object. It's quite obvious that the documentation is missing something and that some questions need to be answered.

· How do you find a list of methods that the ActiveX object supports?
· How do you find the parameters for the method you want to call?
· How do you specify those parameters?

The answer to the first two question is to use the ActiveX Info tool. This tool lists all of the properties, methods, events and constants that an ActiveX control exposes. You can read more about this tool in the ActiveX Overview. Once you know what the parameters are, you just add them like you would for any other SWF Studio call. This will work even though the parameters are not listed in the Input Parameters section.

If you were to look up the Navigate2 method of Internet Explorer Web Browser control (Shell.Explorer) then you would see something like this:

 Navigate2(URL, [Flags], [TargetFrameName], [PostData], [Headers])

The list of names after the method name are the parameters that the method accepts. All parameters are required except for the ones that appear in square brackets like "[Flags]", those are optional. So a sample call to Navigate2 using only the required parameter (URL) would look like this.

ssCore.ActiveX.callMethod({object:"browser1", method:"Navigate2", URL:"http://www.northcode.com"})

If you read the ActiveX Overview section then you know that you can also call ActiveX methods using ssCore.objectName.methodName({object:objectName}) instead of ssCore.ActiveX.methodName({}). In the case of callMethod you can also omit the method parameter and reference to callMethod itself, simplifying the call above to this:

ssCore.browser1.Navigate2({URL:"http://www.northcode.com"})

Both of these call styles produce the same result, but the second is more compact and looks more like the SWF Studio calls to native objects.


Examples:

ssCore.ActiveX.callMethod({object:"MyBrowser", method:"Navigate2", url:"http://www.northcode.com"});