Page 1 of 1

question in SmartFoxClient.as

Posted: 19 May 2006, 20:45
by alvin3343
The following code is from SmartFoxClient.as(AS2)

Code: Select all

	public function getRoomList()
	{
		var header 	= {t:"sys"}
		this.send(header, "getRmList", (this.activeRoomId ? this.activeRoomId:"-1"), "")
	}
and

Code: Select all

	private function send(header:Object, action:String, fromRoom:Number, message:String)
	{
		// Setup Msg Header
		var xmlMsg:String = this.makeHeader(header);
		
		// Setup Body
		xmlMsg += "<body action='" + action + "' r='" + fromRoom + "'>" + message + "</body>" + this.closeHeader()
	
		if (this.debug)
			trace("[Sending]: " + xmlMsg + newline)
	
		super.send(xmlMsg)
	}
3rd param of send function shoud be Number, but getRoomList() may pass "-1" to send().
Is that OK?
can I change "-1" to -1?

Posted: 19 May 2006, 20:48
by alvin3343
The same question in autoJoin function.

Code: Select all

	public function autoJoin()
	{
		var header 	= {t:"sys"}
		this.send(header, "autoJoin", (this.activeRoomId ? this.activeRoomId:-1) , "")
	}

Posted: 20 May 2006, 05:24
by Lapo
is this giving you any problem?
the -1 is sent as a string because the whole message being sent is a string