Protocols/MSNP/Activities/SDK/Techref/Dhtml/Prototyping: Difference between revisions
Animadoria (talk | contribs) (Created automatically by Anima Importer) |
Animadoria (talk | contribs) (Created automatically by Anima Importer) |
||
Line 1: | Line 1: | ||
<!-- Generated @ 08/12/2022 23: | <!-- Generated @ 08/12/2022 23:41:13 +01:00 using Anima's CHM converter based on techref/dhtml/prototyping.htm --> | ||
{{Protocols/MSNP|section=Activities}} | {{Protocols/MSNP|section=Activities}} | ||
__NOTOC__= Required Definitions = | __NOTOC__= Required Definitions = |
Revision as of 22:41, 12 August 2022
Required Definitions
When a MSN Messenger Activity is running, the MSN® Messenger script engine is firing events to the application. These events include indications that data was received or that the connection type changed. In order for two instances of your application to communicate with each other, you must define appropriate event handlers. For example, if you use the SendData method to send a string from one instance to the other, an OnDataReceived event handler must be defined to receive the string. No exception will be thrown if Messenger fires an event that is not defined in your application, but failure to handle events could cause the applications to lose synchronization. Refer to the skeleton code below for the events that should always be defined.
Following are JavaScript examples of required definitions for all multiuser Launch Site applications:
function Channel_OnRemoteAppLoaded() { } function Channel_OnRemoteAppClosed() { } function Channel_OnDataReceived() { } function Channel_OnDataError() { } function Channel_OnTypeChanged() { } function Channel_OnAppClose() { }
Some event handlers must be defined only if your Activity has special permission flags enabled. For example, if an application has the ReceiveIM permission flag enabled, it should define an event handler for the OnIMReceived event.
Following are JavaScript examples of definitions that are required only if special permission flags are enabled:
function Channel_OnIMReceived() { // Only fired if application has ReceiveIM or ReplaceIM permission flag. } function Channel_OnFileReceived() { // Only fired if application has SendFile and ActiveX permission flags. } function Channel_OnFileProgress() { // Only fired if application has SendFile and ActiveX permission flags. } function Channel_OnSendFileCancelled() { // Only fired if application has SendFile and ActiveX permission flags. }