sendXtMessage()
Availability:
Flash Player 6.0
SmartFoxServer Pro
Usage:
smartFox.sendXtMessage(xtName, cmdName, paramObj, type, roomId)
Description:
Sends a request to an extension in the current Zone / Room
Parameters:
| xtName | name of the extension to call | |
| cmdName | name of the command to execute in the extension | |
| paramObj | an object containing all the data to pass to the extension | |
| type | can be "xml" or "str", based on the type of protocol you want to use. By default "xml" is used | |
| roomId | (optional) the id of the room where the request is coming from |
Returns:
Fires the onExtensionResponse event
Example:
// A bullet is being fired
// Let's notify the server side extension
var request = {}
request.type = "bullet"
request.posx = 100
request.posy = 200
request.speed = 10
request.angle = 45
// Invoke "fire" command on the extension called "gameExt"
smartFox.sendXtMessage("gameExt", "fire", request)
See also:
onPublicMessage, sendPrivateMessage()