ssCore.App.sendData

Send data to one or more running SWF Studio applications.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

hwnd - The window handle of the SWF Studio application you want to send data to. If the broadcast parameter is TRUE, the hwnd will be ignored.

broadcast - [Optional] - A boolean value that indicates whether the data should be sent to all running SWF Studio applications or not. Valid values include: true and false.

data - The data to be sent. This can be in any format you can represent in a Flash string.

timeout - [Optional] - A timeout value (in milliseconds) used to determine how long to wait for the receiving application to acknowledge acceptance of the message. If not supplied the timeout is assumed to be infinite (use 0 to specify an infinite timeout).


Output Parameters:

No output parameters.


Asynchronous Mode:

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

ssCore.App.sendData( 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.App.sendData( paramsObject );


Notes:

There are a number of ways to find the HWNDs of other SWF Studio applications you want to communicate with, but one very simple method is to broadcast a sendData message containing your HWND (and whatever other information you like) and then to wait for other running applications to send back their HWNDs.

Examples:

ssCore.App.sendData({broadcast:true, data:"This is application 1"});