| Package | com.kongregate.as3.client.services |
| Interface | public interface IUserServices |
| Method | Defined by | ||
|---|---|---|---|
|
getName():String
Returns the name of the current player.
| IUserServices | ||
|
getPlayerInfo(returnMethod:Function):void
Retrieves specific information describing the player.
| IUserServices | ||
| getName | () | method |
public function getName():String
Returns the name of the current player.
Unlike the getPlayerInfo() method, getName() immediately returns
the player's name without any need to wait for data to load. If you just need the player's name,
make sure to use getName().
String — Player name (e.g. "arcaneCoder"). Returns "Guest" for unregistered users.
|
See also
import com.kongregate.as3.client.KongregateAPI;
trace ( KongregateAPI.getInstance().user.getName() );
| getPlayerInfo | () | method |
public function getPlayerInfo(returnMethod:Function):voidRetrieves specific information describing the player. If this information has previously loaded, a cached version is returned.
ParametersreturnMethod:Function — The method to call when player info has loaded. The data will
be passed to returnMethod in the first parameter.
|
See also
import com.kongregate.as3.client.KongregateAPI;
function onUserInfo ( playerData:Object ):void
{ trace ( "isGuest: "+ playerData.isGuest );
}
KongregateAPI.getInstance().user.getPlayerInfo ( onUserInfo );