PackageTop Level
Classpublic class IDNET
InheritanceIDNET Inheritance flash.display.MovieClip



Public Properties
 PropertyDefined By
  data : Object
Get the last response data object; Available after IDNET Event.
IDNET
  isBlacklisted : Boolean
[read-only] Returns true if game is hosted in one of blacklisted sites.
IDNET
  isInterfaceOpen : Boolean
[read-only] The same as InterfaceOpen() method but in property form.
IDNET
  isLoggedIn : Boolean
[read-only] Check if a user is already logged in.
IDNET
  isProtectionLoaded : Boolean
[read-only] Returns true if protection state is loaded and handled.
IDNET
  isSponsor : Boolean
[read-only] Returns true if game is hosted in one of sponsored sites.
IDNET
  _loggedIn : Boolean = false
IDNET
  _timeMachine : TimeMachine
IDNET
  type : String
Get the last response type; Available after any IDNET Event.
IDNET
  _user : Object
IDNET
  userData : *
[read-only] Get last saved user data without making a new connection.
IDNET
  _userThumb : MovieClip
A movie clip object of the user profile picture.
IDNET
  _verbose : Boolean = true
IDNET
Public Methods
 MethodDefined By
  
The IDnet Flash interface allows secure authentication across applications.
IDNET
  
List all achievements setup at id.net.
IDNET
  
achievementsSave(achName:String, achKey:String, playerName:String, overwrite:Boolean = false, allowDuplicates:Boolean = false):*
When a player has reached a milestone, save an achievement to their account.
IDNET
  
advancedScoreList(table:String, highest:Boolean = true, allowDuplicates:Boolean = false, useMilliseconds:Boolean = false):*
List scores using the advanced scores.
IDNET
  
advancedScoreListCustom(table:String, mode:String, perPage:int, page:int, highest:Boolean, allowDuplicates:Boolean):*
List scores using the advanced scores and a custom interface.
IDNET
  
advancedScoreListPlayer(table:String, highest:Boolean = true, allowDuplicates:Boolean = false):*
List the player's score(s).
IDNET
  
advancedScoreSubmit(points:int, table:String, playerName:String, highest:Boolean = true, allowDuplicates:Boolean = false):*
Submit a id.net player's score using the advanced scores
IDNET
  
advancedScoreSubmitList(points:int, table:String, playerName:String, highest:Boolean = true, allowDuplicates:Boolean = false, useMilliseconds:Boolean = false):void
Submit a guest or id.net player's score using the advanced scores and toggle interface A guest will be given a register to submit button that will cache their score.
IDNET
  
The closeInterfaces method is called when toggleInterface is null and the UI is open.
IDNET
  
customEvent(name:String, value:String = null):void
Sends custom event to be tracked by game analytics. If you send value - you will get a table with total count this value was sent by all users to named table. If value is not set, it will produce valueless named table, with frequency how much this event was sent by each individual user.
IDNET
  
Returns id.net points using type getPoints.
IDNET
  
Get the user's profile.
IDNET
  
handleLoginConnection(jsonData:String, passThrough:Object):void
IDNET
  
init(stageRef:Stage, appId:String, appSecret:String = null, verbose:Boolean = true, preload:Boolean = false, protection:Boolean = false):void
Initialize the IDNET AS3 Interface.
IDNET
  
InterfaceOpen():Boolean
Check if interface is visible.
IDNET
  
mapListCustom(_mode:String, perPage:int, page:int, returnData:Boolean):*
Return listing data for a custom player maps interface.
IDNET
  
mapLoad(mapId:String):void
Load a player created map.
IDNET
  
mapRate(mapId:String, rating:int):*
Rate a player's custom map for list sorting.
IDNET
  
mapSave(mapName:String, mapData:String, playerName:String):*
Save a player's custom map
IDNET
  
onIoError(event:IOErrorEvent):void
IDNET
  
IDNET
  
removeUserData(key:String, passThroughKey:String = null):*
Removes user's data.
IDNET
  
retrieveUserData(key:String, passThroughKey:String = null):*
Retrieve user's data.
IDNET
  
submitProfileImage(target:DisplayObject, ext:String, drawRectangle:Rectangle = null):void
Submits an image to the id.net user's profile
IDNET
  
submitUserData(key:String, data:*, passThroughKey:String = null):*
Submit user's data
IDNET
  
toggleInterface(type:String = null):void
Toggles the interface open or closed.
IDNET
Property Detail
_loggedInproperty
public var _loggedIn:Boolean = false

_timeMachineproperty 
public var _timeMachine:TimeMachine

_userproperty 
public var _user:Object

_userThumbproperty 
public var _userThumb:MovieClip

A movie clip object of the user profile picture. 32x32 pixels.

_verboseproperty 
public var _verbose:Boolean = true

dataproperty 
public var data:Object

Get the last response data object; Available after IDNET Event.

isBlacklistedproperty 
isBlacklisted:Boolean  [read-only]

Returns true if game is hosted in one of blacklisted sites.


Implementation
    public function get isBlacklisted():Boolean
isInterfaceOpenproperty 
isInterfaceOpen:Boolean  [read-only]

The same as InterfaceOpen() method but in property form.


Implementation
    public function get isInterfaceOpen():Boolean
isLoggedInproperty 
isLoggedIn:Boolean  [read-only]

Check if a user is already logged in.


Implementation
    public function get isLoggedIn():Boolean
isProtectionLoadedproperty 
isProtectionLoaded:Boolean  [read-only]

Returns true if protection state is loaded and handled.


Implementation
    public function get isProtectionLoaded():Boolean
isSponsorproperty 
isSponsor:Boolean  [read-only]

Returns true if game is hosted in one of sponsored sites.


Implementation
    public function get isSponsor():Boolean
typeproperty 
public var type:String

Get the last response type; Available after any IDNET Event.

userDataproperty 
userData:*  [read-only]

Get last saved user data without making a new connection.


Implementation
    public function get userData():*
Constructor Detail
IDNET()Constructor
public function IDNET()

The IDnet Flash interface allows secure authentication across applications.

Note 1 - Because of security sandboxes with flash, swf files loading from the desktop will be unable to connect to the interface. Use the flash IDE, exportant to exe, or add the output folder to flash's trusted locations.

Method Detail
achievementsList()method
public function achievementsList():void

List all achievements setup at id.net. If a player is logged in, the achievementsList data will show which achievements they have unlocked. This method can be used to create a custom achievement list interface. To Use the id.net achievement interface, use toggleInterface.

achievementsSave()method 
public function achievementsSave(achName:String, achKey:String, playerName:String, overwrite:Boolean = false, allowDuplicates:Boolean = false):*

When a player has reached a milestone, save an achievement to their account.

Parameters

achName:String — The title of achievement. It must exactly match the achievement setup on id.net
 
achKey:String — The achievement key. It must exactly match the achievement setup on id.net along with achName.
 
playerName:String — (optional) Either a in-game player name or an empty string to default to an id.net nickname.
 
overwrite:Boolean (default = false) — (optional) True or false for overwriting achievements. defaults to false.
 
allowDuplicates:Boolean (default = false) — (optional) True or false is an achievement can be given more than once. Defaults to false.

Returns
*false if user is not logged in.
advancedScoreList()method 
public function advancedScoreList(table:String, highest:Boolean = true, allowDuplicates:Boolean = false, useMilliseconds:Boolean = false):*

List scores using the advanced scores. After calling this, the id.net scoreboard will be toggled.

Parameters

table:String — Should be capitalized like a title as it is shown to players.
 
highest:Boolean (default = true) — (optional) False if lower score is better.
 
allowDuplicates:Boolean (default = false) — (optional) True is a player can score more than once like a classic leaderboard or false if better scores replace old ones.
 
useMilliseconds:Boolean (default = false) — (optional) Set to true to display score with a time format (mm:ss:SSS)

Returns
*
advancedScoreListCustom()method 
public function advancedScoreListCustom(table:String, mode:String, perPage:int, page:int, highest:Boolean, allowDuplicates:Boolean):*

List scores using the advanced scores and a custom interface. Returns data only and does not open an id.net interface.

Parameters

table:String — Should be capitalized like a title as it is shown to players.
 
mode:String — A string that uquals alltime, last30days, last7days, today, or newest.
 
perPage:int — Number of results to show per page. Limit 100.
 
page:int — page number to offset results. starts at 1.
 
highest:Boolean — False if a lower score is better.
 
allowDuplicates:Boolean — True if a player can score more than once like a classic leaderboard or false if better scores replace old ones.

Returns
*false When mode is an incorrect string or prePage is greater than 100.
advancedScoreListPlayer()method 
public function advancedScoreListPlayer(table:String, highest:Boolean = true, allowDuplicates:Boolean = false):*

List the player's score(s).

Parameters

table:String — The name of the leaderboard table.
 
highest:Boolean (default = true) — (optional) False if lower score is better.
 
allowDuplicates:Boolean (default = false) — (optional) True to show all player scores. Default is to only show the best score.

Returns
*false if user is not logged in.
advancedScoreSubmit()method 
public function advancedScoreSubmit(points:int, table:String, playerName:String, highest:Boolean = true, allowDuplicates:Boolean = false):*

Submit a id.net player's score using the advanced scores

Parameters

points:int — The player's score
 
table:String — Should be capitalized like a title as it is shown to players.
 
playerName:String — (optional) The player's in-game name or an empty string to default to an id.net nickname.
 
highest:Boolean (default = true) — (optional) False if lower score is better.
 
allowDuplicates:Boolean (default = false) — (optional) True if a player can score more than once like a classic leaderboard or false if better scores replace old ones.

Returns
*false if user is not logged in.
advancedScoreSubmitList()method 
public function advancedScoreSubmitList(points:int, table:String, playerName:String, highest:Boolean = true, allowDuplicates:Boolean = false, useMilliseconds:Boolean = false):void

Submit a guest or id.net player's score using the advanced scores and toggle interface

A guest will be given a register to submit button that will cache their score. If they register, it will take them back to the scores interface.

Parameters

points:int — The player's score
 
table:String — Should be capitalized like a title as it is shown to players.
 
playerName:String — (optional) The player's in-game name or an empty string to default to an id.net nickname.
 
highest:Boolean (default = true) — (optional) False if lower score is better.
 
allowDuplicates:Boolean (default = false) — (optional) True if a player can score more than once like a classic leaderboard or false if better scores replace old ones.
 
useMilliseconds:Boolean (default = false) — (optional) Set to true to display score with a time format (mm:ss:SSS)

closeInterfaces()method 
public function closeInterfaces():void

The closeInterfaces method is called when toggleInterface is null and the UI is open. Use this with care, in almost all cases, the users will handle closing an id.net interface.

customEvent()method 
public function customEvent(name:String, value:String = null):void

Sends custom event to be tracked by game analytics. If you send value - you will get a table with total count this value was sent by all users to named table. If value is not set, it will produce valueless named table, with frequency how much this event was sent by each individual user.

Parameters

name:String — table name
 
value:String (default = null) — optional value to store data by.

See also

getPoints()method 
public function getPoints():*

Returns id.net points using type getPoints.

Returns
*
getProfile()method 
public function getProfile():*

Get the user's profile. Remember to set the permissions you want on the app settings page.

Returns
*false if user is not logged in.
handleLoginConnection()method 
public function handleLoginConnection(jsonData:String, passThrough:Object):void

Parameters

jsonData:String
 
passThrough:Object

init()method 
public function init(stageRef:Stage, appId:String, appSecret:String = null, verbose:Boolean = true, preload:Boolean = false, protection:Boolean = false):void

Initialize the IDNET AS3 Interface. For examples of how to call this method from a timeline or document class look at the provided examples.

Parameters

stageRef:Stage — Reference to the stage.
 
appId:String — The Application ID strong from the idnet website.
 
appSecret:String (default = null) — The application secret key string (not implemented).
 
verbose:Boolean (default = true) — Set to true by default. Set the debug param to false to disable idnet traces.
 
preload:Boolean (default = false)
 
protection:Boolean (default = false)

InterfaceOpen()method 
public function InterfaceOpen():Boolean

Check if interface is visible.

Returns
Booleantrue If interface is visible; false if interface is hidden.
mapListCustom()method 
public function mapListCustom(_mode:String, perPage:int, page:int, returnData:Boolean):*

Return listing data for a custom player maps interface.

Parameters

_mode:String — Acceptable modes are alltime, newest, popular, todayaverage, yesterdayaverage, last7daysaverage, last30daysaverage, last90daysaverage
 
perPage:int — Integer of how many results to return. Limit 50 with return data false or 10 with it true.
 
page:int — Integer of how many to offset based on perPage
 
returnData:Boolean — False if you want map data on the list. Good for previews but should limit perpage to 10 so download speeds are fast.

Returns
*false if perPage is set too high.
mapLoad()method 
public function mapLoad(mapId:String):void

Load a player created map.

Parameters

mapId:String — the levelid returned after saving a map or from the custom map list function. This will get called automatically when using the id.net player maps interface.

mapRate()method 
public function mapRate(mapId:String, rating:int):*

Rate a player's custom map for list sorting. Rating requires id.net login to prevent cheating.

Parameters

mapId:String — the levelid returned after saving or loading a map.
 
rating:int — A rating interger from 1 to 10. If you want to use like/dislike buttons use rating numbers 10 and 1.

Returns
*false if user is not logged in.
mapSave()method 
public function mapSave(mapName:String, mapData:String, playerName:String):*

Save a player's custom map

Parameters

mapName:String — The name of the map.
 
mapData:String — A string representation of a map. Best to use json as it comes with methods to convert to strings/objects. Max size is 100 KB or roughly 100 000 characters.
 
playerName:String — (optional) Either a in-game player name or an empty string to default to an id.net nickname.

Returns
*false if user is not logged in.
onIoError()method 
public function onIoError(event:IOErrorEvent):void

Parameters

event:IOErrorEvent

openProfile()method 
public function openProfile():void

removeUserData()method 
public function removeUserData(key:String, passThroughKey:String = null):*

Removes user's data.

Parameters

key:String — A unique key string to index the data.
 
passThroughKey:String (default = null)

Returns
*false if user is not logged in.
retrieveUserData()method 
public function retrieveUserData(key:String, passThroughKey:String = null):*

Retrieve user's data.

Parameters

key:String — A unique key string to index the data.
 
passThroughKey:String (default = null)

Returns
*false if user is not logged in.
submitProfileImage()method 
public function submitProfileImage(target:DisplayObject, ext:String, drawRectangle:Rectangle = null):void

Submits an image to the id.net user's profile

Parameters

target:DisplayObject — A movie clip or sprite. Size the display object to a good size of 600 x 400. If larger the image will be scaled and cropped.
 
ext:String — A string of jpg or png. If the display object has a very limited color palette use png. If there are gradients or many colors use jpg.
 
drawRectangle:Rectangle (default = null)

submitUserData()method 
public function submitUserData(key:String, data:*, passThroughKey:String = null):*

Submit user's data

Parameters

key:String — A unique key string to index the data.
 
data:* — Data string to be stored.
 
passThroughKey:String (default = null)

Returns
*false if user is not logged in.
toggleInterface()method 
public function toggleInterface(type:String = null):void

Toggles the interface open or closed. If type is null it will default to the login interface. If the interface is open and type is null, it will close. Acceptable interface type strings are login, registration, achievements, and playerMaps. To show the interface for advanced scores, use either the advancedScoreList or advancedScoreSubmitList functions and not toggleInterface. To access the depreciated simple scores use type scoreboard.

Parameters

type:String (default = null) — An optional string to identify what user interface dialog to show. Defaults to null