question in SmartFoxClient.as

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

question in SmartFoxClient.as

Post 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?
regards.


Alvin
alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

Post 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) , "")
	}
regards.


Alvin
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

is this giving you any problem?
the -1 is sent as a string because the whole message being sent is a string
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply