Flash Challenge.getCustomInformation()

From J2Play

Jump to: navigation, search

Contents

Description

Get the expandable challenge information which developer can use to store game state and other stuffs. It is a map with Key => Array of Values

Syntax

public function getCustomInformation(key : String, index: Number) : Object;

Parameters

* @param key the name of data key
* @param index the array index of value array, if index = -1 means the value is not a array.

Return Value

@return value object

Examples

Get the game seed related to this challenge, this information is expanded by game developer.

var game_seed: Number = challenge.getCustomInformation('game_seed',-1);

Get the flag number of every player.

var flag: Array;
flag[0] = challenge.getCustomInformation('player_flag',0);
flag[1] = challenge.getCustomInformation('player_flag',1);
Personal tools