![]() |
|
|||||||||||
|
Please report any problem or bug in our support forums
/*
* SmartFoxServer PRO
* Test LoadVars
* v 1.1.0 beta
*
*/
function init()
{
var _send = new LoadVars()
var _load = new LoadVars()
// Set parameters to send
_send.name = "Albert"
_send.surname = "Einstein"
_send.job = "genius"
_send.location = "Germany"
// Handle the remote data
_load.onLoad = function(success, errorMsg)
{
if (success)
{
trace("Data received:")
trace("Name : " + this.name)
trace("Surname : " + this.surname)
trace("Job : " + this.job)
trace("Location: " + this.location)
}
else
{
trace("Loadvar Failed. " + errorMsg)
}
}
// Send data with POST method and receive it back in the _load object
_send.sendAndLoad("http://www.smartfoxserver.com/temp/loadvars.php", _load, "post")
}
function destroy()
{
trace("Bye bye!")
}
function handleRequest(cmd, params, user, fromRoom)
{
//
}
function handleInternalEvent(evt)
{
//
}
Public Message event handling:
/**
* Extension intialization
* This example can be used as Zone level extension
*/
function init()
{
/*
enable "pubMsg" internal events
by default this event is turned off
*/
var zone = _server.getCurrentZone()
zone.setPubMsgInternalEvent(true)
}
/**
* Handle internal events
*
* @param e the event object
*/
function handleInternalEvent(e)
{
evtName = e.name
if (evtName == "pubMsg")
{
sourcRoom = e.room // the room object
senderUser = e.user // the sender user
message = e.msg // the public message
// ... do something cool here ...
}
}
Download Download SmartFoxServer PRO 1.4.2beta patch
|
|||||||||||
| | Homepage | Overview | Products | Services | Showcase | Support | Contacts | gotoAndPlay.it | |
| | SmartFoxBits | BlueBox | RedBox | Clustering| BattleFarm | OpenSpace | |
| (c) gotoAndPlay() 2005-2008 - All rights reserved. P.IVA 03121770048 |