getVariable(name)

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Poyz
Posts: 83
Joined: 28 Mar 2006, 14:27

getVariable(name)

Postby Poyz » 26 Apr 2006, 10:36

can't get this method to work...
i read on docs:
getVariable(name) Return the room variable with the requested name
i got a variable in a room and i try to trace it with:

trace(room.getVariable("variable"))

and i get:

it.gotoandplay.smartfoxserver.data.RoomVariable@afae4a

any ideas?
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 26 Apr 2006, 10:47

As Lapo says it better
Since the Room object is a native java object it [the getVariables() method] will return another native java object, specifically an HashMap

I've encountered this problem here > viewtopic.php?t=279&highlight=room+variable+getvalue
when using getVariables().

I would have expected that getVariable('name') would return the actual value. But since it seems that returns a java object use the getValue() to obtain it's value.

Code: Select all

trace(room.getVariable("variable").getValue()) ;
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
Poyz
Posts: 83
Joined: 28 Mar 2006, 14:27

Postby Poyz » 26 Apr 2006, 10:51

thanks ;)

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 41 guests