sendXtMessage()

Availability:

Flash Player 7, 8
SmartFoxServer Pro

Usage:

smartFox.sendXtMessage(xtName:String, cmdName:String, paramObj:Object, type:String, roomId:Number)

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:Object = {}
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)


You can learn more about Server side extensions by checking section 6 of the SmartFoxServer PRO documentation.

See also:

onPublicMessage, sendPrivateMessage()