Flash Challenge.Flash Challenge API

From J2Play

Jump to: navigation, search

This is a list of all available functions in the Challenge object. For a tutorial on how to add challenges to your game see Flash Challenge Tutorial

Contents

Challenge.getId()

Gets the id of the challenge object

Challenge.getPlayerNumber()

Gets the number of players in the challenge

Challenge.getMyIndex()

Gets the current user's player index

Challenge.getUsername()

Gets the username for any player in the challenge

Challenge.getNickname()

Gets the screen name of any player in the challenge

Challenge.getImageUrl()

Gets the url for a players profile picture

Challenge.getPlayerStatus()

Gets status of a player, one of (NONE, ACCEPTED, DECLINED, PLAYING, WAITING, FINISHED)

Challenge.getPlayerPendingStatus()

Gets whether or not the challenge system is waiting for the player to respond to the challenge invite or not

Challenge.getGameStatus()

Gets the status of the challenge. one of (NEW, IN PROGRESS, COMPLETED)

Challenge.getDisplayMessage()

Gets the display message of a user. Ex "You won!"

Challenge.setDisplayMessage()

Sets the display message for a particular user;

Challenge.setDisplayMessages()

Sets the display message for a list of users

Challenge.getResult()

Gets the challenge result for a user. one of (NONE, WIN, LOST, TIE)

Challenge.setResult()

Sets the result for a user

Challenge.getScore()

Gets the score for a user.

Challenge.setScore()

Sets the score for a user

Challenge.getCustomInformation()

Gets a value from the game specific data in the challenge object

Challenge.setCustomInformation()

Sets a value in the game specific data in the challenge objcet

Challenge.updateGamePlay()

Updates the system indicating the player has started their turn

Challenge.updateNextTurn()

Updates the state of the challenge indicating the next person who should go

Challenge.updateGameEnd()

Indicates that the game is over. This doesn't need to be called if finished is set to true in updateNextTurn

Personal tools