PackageTop Level
Classpublic class GamerSafe
InheritanceGamerSafe Inheritance flash.display.Sprite

GamerSafe API Class

The GamerSafe API Class is designed to be easy to use, and fast to implement. Implementation only takes one line of code, so getting started is really simple!

Implementation:

So, you want to use GamerSafe in your game, but where do you begin?! It's simple, paste this code into your project and you'll be well on your way:

Flash - on the main timeline, in Frame 1, put:
var _gamerSafe:GamerSafe = new GamerSafe(this);

Flex Builder - in your main mxml file, add a listener for addedToStage. In your listener function, put:
new GamerSafe(stage);

Congratulations! You've implemented GamerSafe!

Now you need to do some setting-up. Luckily, GamerSafe has all the functions available for you to use right away. All of the functions are listed and documented below, so have a quick look through this page and you'll soon learn all you need. To make it even easier, here is a quick overview of the functions that you'll use the most:

Example code and API Overview

The first thing I want to talk about is the GamerSafe Status bar. This little bar is a great help! It will sit in the bottom left hand corner of your game, and pop up when your user want's to use it. You can hide it completley by using the API functions, but if your user leaves it alone, it will hide away in the corner itself.

The status bar looks like this:

By default, the status bar will appear in your game. It will shrink itself down to the "Auto-hide" state when not in use, and pop back up to the normal state when the user moves their mouse over it.

If you would like to completley hide the bar, you can call:

GamerSafe.api.hideStatusBar();

And to show it:

GamerSafe.api.showStatusBar();

Note that you cannot call these functions until the session has started. Call them from the beginSession callback at the earliest.

Interface functions

Most of the functions on the GamerSafe API are very self explanitory. Here are some examples of some functions that are available to you when using the API:

GamerSafe.api.showShop();
GamerSafe.api.showAchievements();
GamerSafe.api.showLogin();
GamerSafe.api.showPopup(text:String);
GamerSafe.api.showMessageBox(title:String, text:String, isConfirm:Boolean);

Events

This is a very important section, as the events are not documented below.

The following events are dispatched from the GamerSafe object:

The event system for GamerSafe offers some helpful functions to easily assign event listeners. An example of the two different ways to assign an event listener are:

GamerSafe.api.addEventListener('login', myFunction);
GamerSafe.api.onLogin = myFunction;

The first method - the conventional way using addEventListener will require your function to accept 1 argument, like so:
function myFunction(e:Event):void
The second method does not require this argument, therefor the function should be declared like so:
function myFunction():void
Please note that with the second method of adding an event listener, you can only assign ONE event to be fired. Use addEventListener if you require to fire more than one function.

Look and Feel:

The function setStyle will allow you to specify the default theme for every component displayed by GamerSafe. Please see the setStyle documentation. You can configure the Achievement popup with the setAchievementStyle() function.

Some functions take an optional "configuration" parameter. Examples are showShop(), showAchievements(), or showPopup(). If provided, this should be an Object with one or more special variables set. These variables determine the look and feel of that specific component. Not all of the following values are acceptable for every component.

Also, check out the GamerSafe Developer's Guide. A sample project is also available.



Public Properties
 PropertyDefined by
  account : Object
[read-only] Use this to access the current user's account object.
GamerSafe
  achievementPopupPosition : Point
GamerSafe
  achievements : Array
[read-only] Get a list of the achievements.
GamerSafe
  api : GamerSafe
[static][read-only] The api variable allows you to access your instance of GamerSafe from anywhere in your code.
After constructing your GamerSafe object, one of the easiest ways of accessing the API functionality is by using GamerSafe.api.
GamerSafe
  apiLoaded : Boolean
[static][read-only] Returns true if the API has been initialised by the constructor.
GamerSafe
  applicationDomain : ApplicationDomain
[read-only]
GamerSafe
  autoLogin : Boolean
If this is set to FALSE before the session is started, the user will not be automatically logged in to their GamerSafe account.
GamerSafe
  countryCode : String
[read-only] Retrieves the country code of the user playing the game, based on their IP4 address.
GamerSafe
  facebookFriends : Array
[read-only] This function returns an array of Objects listing the user's Facebook friends.
GamerSafe
  facebookLocalUser : Object
[read-only] This function returns an object containing information about the currently logged in user.
GamerSafe
  facebookLocalUserId : int
[read-only] Returns the Facebook user ID for the current user.
GamerSafe
  facebookLoggedIn : Boolean
[read-only] This function will let you know if the user is currently logged in to Facebook.
GamerSafe
  failed : Boolean
[read-only] Returns true if something went wrong.
GamerSafe
  FAQUrl : String
[read-only] The FAQ URL is the most up-to-date GamerSafe user FAQ.
GamerSafe
  gameAuthCode : String
[read-only] Used with PlayerIO QuickConnect.
GamerSafe
  gamerGold : uint
[read-only] This variable will return the current user's balance, in GamerGold.
GamerSafe
  gamerPoints : uint
[read-only] This variable will return the current user's balance, in GamerPoints.
GamerSafe
  gamerTestMode : Boolean
[read-only] This variable will return whether the logged-in user is a test account.
GamerSafe
  gamerXP : uint
[read-only] This variable will return the XP of the current user.
GamerSafe
  highScore : Number
Gets the current highscore as a number.
GamerSafe
  iconUrl : String
[read-only] The iconURL is a location where your game's achievement and item icons can be accessed from the web.
GamerSafe
  inSession : Boolean
[read-only] inSession will be set to "True" if you are currently connected to GamerSafe.
GamerSafe
  inUse : Boolean
[read-only] You can use the inUse variable to determine whether your player is currently using the GamerSafe components or not.
GamerSafe
  isGamerGoldPurchaseDisabled : Boolean
[read-only] Returns true if the current portal the game is on disallows GamerGold purchases.
GamerSafe
  items : Array
[read-only] Get a list of all items.
GamerSafe
  latestItemConsumptionInfo : Object
[read-only] Retrieve information about the last item-consumption attempt by the user during this session.
GamerSafe
  latestItemPurchaseInfo : Object
[read-only] Retrieve information about the last item-purchase attempt by the user during this session.
GamerSafe
  latestOtherGameProfile : Object
[read-only] The results of the latest call to requestOtherGameProfile.
GamerSafe
  latestScoreboardEntries : Object
[read-only] You should get object when the EVT_SCOREBOARD_ENTRIES_RECEIVED event fires.
GamerSafe
  levelVaultLastCreatedLevelID : uint
[read-only] Returns the internal level ID of the last level created in the LV by this client.
GamerSafe
  levelVaultLastEditedLevelID : uint
[read-only]
GamerSafe
  levelVaultLastError : String
[read-only] The last error that the level vault interface has encountered.
GamerSafe
  levelVaultLastSelectedLevelsReceipt : int
[read-only]
GamerSafe
  levelVaultReady : Boolean
[read-only] The level vault becomes ready shortly before you get the beginSession event.
GamerSafe
  levelVaultShareCookie : String
[read-only]
GamerSafe
  loaded : Boolean
[read-only] The loaded variable will return 'true' when the API has succesfully been downloaded from the GamerSafe servers
GamerSafe
  loggedIn : Boolean
[read-only] The loggedIn variable will be set to TRUE after a user has succesfully logged in.
GamerSafe
  partner : String
[write-only] Partner/sponsor stuff
GamerSafe
  paymentUrl : String
[read-only] The payment URL is the web page to show users that want to add GamerGold to their account.
GamerSafe
  savedGame : String
Returns the current saved game, or an empty string if you've never set the savedGame.
GamerSafe
  signupUrl : String
[read-only] The signup URL is the web page to show users that want to sign up for GamerSafe.
GamerSafe
  startingTime : Date
[read-only] Retrieves the time the game connected to GamerSafe, in GMT.
GamerSafe
  status : String
[read-only] The status variable allows you to determine the current status of the API.
GamerSafe
  twitterLoggedIn : Boolean
[read-only] This function will let you know if the user is currently logged in to Twitter.
GamerSafe
  twitterUser : XML
[read-only] Returns the Twitter user data for the current user.
GamerSafe
  unregisteredName : String
[read-only] Gets the unregistered name.
GamerSafe
  userAuthKey : String
[read-only] Used with PlayerIO QuickConnect.
GamerSafe
  username : String
[read-only] Use this to access the current user's username.
GamerSafe
  wantsNewsletter : Boolean
The "wantsNewsletter" boolean is intended to be connected to a check-box widget in your game.
GamerSafe
Public Methods
 MethodDefined by
  
GamerSafe(parent:*, passcode:String = null, hashseed:String = null, isAir:Boolean = false)
GamerSafe constructor.
Important Note: You must only create one instance of the GamerSafe object in your project.
GamerSafe
  
bestowAchievement(achievementId:uint):Boolean
bestowAchievement is the function that you call to give an achievement to the currently logged in user.
GamerSafe
  
bestowFreeItem(itemID:int):Boolean
bestowFreeItem will instantly and silently grant the user an item.
GamerSafe
  
Closes the currently open 'buy item' interface.
GamerSafe
  
Close the open scoreboard dialog
GamerSafe
  
closeShop():void
Manually hides the Shop interface.
GamerSafe
  
configureView(config:Object):void
Establishes a default configuration for all the GS UI windows, see the main class comments for the various values that can be set.
GamerSafe
  
consumeItem(itemId:int, numToConsume:int):void
Attempts to "consume" a consumable item.
GamerSafe
  
disable():void
Disable the API.
GamerSafe
  
enable():void
Re-enables the API if it's been disabled using the disable() function.
GamerSafe
  
facebookConfigureAttachment(name:String, caption:String = null, description:String = null, link:String = null, picture:String = null):void
Use this function to configure an attachment for facebookWallPost.
GamerSafe
  
facebookConnect(requireLogin:Boolean = false):void
Use this function to pop up the GamerSafe Facebook Login screen in a new window.
GamerSafe
  
facebookGetPicture(uid:String = "me"):URLRequest
This function returns an URLRequest that will load the profile picture of a Facebook user (from the facebookFriends array).
GamerSafe
  
facebookWallPost(text:String, target:String = "me"):void
This function lets you write to a Facebook wall as the logged in user.
GamerSafe
  
fetchAvatars(uids:Array = null):Array
This function is useful with the LevelVault, so that you can fetch the avatars of account creators.
GamerSafe
  
fetchUsernames(uids:Array = null):Array
This function is useful with the LevelVault, so that you can fetch the names of account creators.
GamerSafe
  
flashBar():void
Makes the GamerSafe status bar flash.
GamerSafe
  
Returns the current Achievement popup style settings.
GamerSafe
  
getAvatar(uid:uint):String
This function is like fetchAvatars except it will never call the server.
GamerSafe
  
getConsumptionsAvailable(itemId:int):int
Retrieves the number of "consume"s a given item has.
GamerSafe
  
getItemById(item_id:int):Object
Get a specific item from it's item ID.
GamerSafe
  
getSavedGame(idx:int = 0):String
Returns a saved game.
GamerSafe
  
getSkin():Object
Returns the current global style settings.
GamerSafe
  
getUsername(uid:uint):String
This function is like fetchUsernames except it will never call the server.
GamerSafe
  
hasAchievement(achievementId:int):Boolean
You can use this function to check wether the user has had an achievement bestowed to them or not.
GamerSafe
  
hasItem(itemId:int):Boolean
You can use this function to check wether the user owns the item queried.
GamerSafe
  
Hides the friends list control when you're done with it.
GamerSafe
  
Completely hides the GamerSafe UI and all of its children.
GamerSafe
  
Hides the publisher control when you're done with it.
GamerSafe
  
hideShopButton(disable:Boolean = true):void
hideShopButton() will allow you to disappear the shop button on the status bar.
GamerSafe
  
hideStatusBar() will completley remove the status bar from the screen.
GamerSafe
  
Hides the publisher control when you're done with it.
GamerSafe
  
levelVaultCreateLevel(levelData:*):Boolean
This function will create a new Level in the LV.
GamerSafe
  
levelVaultCreateLevelFromBytes(levelData:ByteArray):Boolean
This function will create a new Level in the LV.
GamerSafe
  
levelVaultCreateLevelFromObject(level:Object):Boolean
This function will create a new Level in the LV.
GamerSafe
  
levelVaultCreateLevelWithAttributes(levelData:*, attributes:Object):Boolean
Conveniently creates a level and then assigns attributes to it for you once it's made.
GamerSafe
  
levelVaultDeleteLevel(levelOrLevelId:*):Boolean
GamerSafe
  
levelVaultEditLevel(levelOrLevelId:*, levelData:ByteArray):Boolean
Updates the data stored for a level.
GamerSafe
  
levelVaultFetchLevelByID(levelId:int):Boolean
GamerSafe
  
levelVaultFlagLevel(levelOrLevelId:*):Boolean
GamerSafe
  
levelVaultGetAllLevels(ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetAttributeRanking(value:int, attribute:String, ascending:Boolean = false):Boolean
GamerSafe
  
levelVaultGetIndexAdvanced(attributes:Array, order:Array, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
GamerSafe
  
GamerSafe
  
GamerSafe
  
GamerSafe
  
GamerSafe
  
levelVaultGetLevelAsCustomObject(type:Class, level:Object = null):*
This function will attempt to copy the information in the given LV object into a new instance of the type you pass.
GamerSafe
  
levelVaultGetLevelAsObject(level:Object = null):Object
This will use the ByteArray.readObject() function to create an object from the level data you pass it.
GamerSafe
  
levelVaultGetLevelAttributes(level:Object = null):Array
GamerSafe
  
levelVaultGetLevelData(level:Object = null):ByteArray
GamerSafe
  
levelVaultGetLevelID(level:Object = null):uint
GamerSafe
  
levelVaultGetLevelNumRatings(level:Object = null):int
GamerSafe
  
levelVaultGetLevelRanking(levelId:int, attribute:String, ascending:Boolean = false):Boolean
GamerSafe
  
levelVaultGetLevelRating(level:Object = null):Number
GamerSafe
  
levelVaultGetLevelsAdvanced(attributes:Array, order:Array, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsByDateCreated(start_date:String, end_date:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsByDateModified(start_date:String, end_date:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsByNumericData(key:String, min:Number, max:Number, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsByRating(min_rating:Number, max_rating:Number, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsByStringData(key:String, value:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsLike(key:String, value:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):int
GamerSafe
  
levelVaultGetLevelsRandom(count:uint):int
GamerSafe
  
GamerSafe
  
levelVaultGetNumLevelsAdvanced(attributes:Array):int
GamerSafe
  
levelVaultIncrementNumeric(levelOrLevelId:*, key:String):Boolean
GamerSafe
  
levelVaultIncrementNumerics(levelOrLevelId:*, keys:Array):Boolean
GamerSafe
  
levelVaultRateLevel(levelOrLevelId:*, rating:uint):Boolean
GamerSafe
  
levelVaultRegisterCallback(callback:Function, ... args):void
GamerSafe
  
levelVaultRegisterErrorCallback(callback:Function, ... args):void
GamerSafe
  
levelVaultRegisterPersistentErrorCallback(callback:Function, ... args):void
GamerSafe
  
levelVaultSetAttributes(levelOrLevelId:*, attributes:Object):Boolean
GamerSafe
  
levelVaultSetExpiringNumericAttribute(levelOrLevelId:*, key:String, value:Number, expires:String):Boolean
GamerSafe
  
levelVaultSetExpiringNumericAttributes(levelOrLevelId:*, keys:Array, data:Array, expires:Array):Boolean
GamerSafe
  
levelVaultSetExpiringStringAttribute(levelOrLevelId:*, key:String, value:String, expires:String):Boolean
GamerSafe
  
levelVaultSetExpiringStringAttributes(levelOrLevelId:*, keys:Array, data:Array, expires:Array):Boolean
GamerSafe
  
levelVaultSetNumericAttribute(levelOrLevelId:*, key:String, value:Number):Boolean
GamerSafe
  
levelVaultSetNumericAttributes(levelOrLevelId:*, keys:Array, data:Array):Boolean
GamerSafe
  
levelVaultSetStringAttribute(levelOrLevelId:*, key:String, value:String):Boolean
GamerSafe
  
levelVaultSetStringAttributes(levelOrLevelId:*, keys:Array, data:Array):Boolean
GamerSafe
  
levelVaultSwitchGame(passcode:String = ""):Boolean
Have you ever wanted to access the LV data for another game from this one? Go for it! Use with extreme caution.
GamerSafe
  
login(username:String, password:String, rememberMe:Boolean = false):void
This function allows you to log a specified user in.
GamerSafe
  
logout():void
"Logging out" causes the system to stop trying to re-log-in the user.
GamerSafe
  
purchaseItem(itemID:int, priceID:int = 0):Boolean
purchaseItem will cause a given item to be purchased.
GamerSafe
  
purchaseItemInterface(itemId:int, priceID:int = 0):void
Shows the purchase item popup.
GamerSafe
  
requestOtherGameProfile(otherGamePasscode:String):void
This is an advanced feature for developers who are writing sequels to an earlier GamerSafe game they have already launched.
GamerSafe
  
requestScoreboardEntries(scoreboardID:int = -1):void
Requests an array of the scoreboard entries.
GamerSafe
  
Sends a request to retrieve the unregistered players username, determined by the name that they enter into the scoreboard submission box.
GamerSafe
  
saveToScoreboard(score:Number, extra:String, scoreboardID:int = -1, unregistered_name:String = ""):void
Save a score to the scoreboard.
GamerSafe
  
setAchievementStyle(name:String, value:*):void
setAchievementStyle should be used to set the achievement popup's visual settings.
GamerSafe
  
setRegistrationDefaults(defaults:Object):void
Use this function to pre-populate the Register dialog, if you have access to any information about the user.
GamerSafe
  
setSavedGame(save:String, idx:int = 0):void
Writes a saved game.
GamerSafe
  
setShopCategoryVisible(category:int, visible:Boolean):void
Displays/Hides a category globablly from the shop.
GamerSafe
  
setStyle(name:String, value:*):void
setStyle should be used to set the global theme settings.
GamerSafe
  
showAchievements(configuration:Object = null):void
This function will display a window, overlayed onto your game, which contains an organised list of possible Achievements that your players can unlock.
GamerSafe
  
showFriendsList(x:int, y:int, width:int = 400, height:int = 350):void
Like showFriendsPanel but without the dialog frame.
GamerSafe
  
showFriendsPanel(width:int = 400, height:int = 350):void
This function shows a dialog containing a list of Facebook Friends for the logged in user.
GamerSafe
  
showFriendsScoreboard(scoreboardId:int = -1):void
Shows the requested scoreboard, filtered by facebook friends.
GamerSafe
  
Reverses hideInteface().
GamerSafe
  
showLogin(configuration:Object = null):void
This function will display the login form, overlayed onto your game.
GamerSafe
  
showMessageBox(title:String, text:String, isConfirm:Boolean = true):void
showMessageBox allows you to display a GamerSafe-styled message box with a custom message to the player.
GamerSafe
  
showPopup(text:String, configuration:Object = null):void
shopPopup will show a popup box, overlayed on top of your game.
GamerSafe
  
showPublisher(x:int, y:int, uids:Array = null, width:int = 400, height:int = 350):void
Like showPublisherPanel but without the dialog frame.
GamerSafe
  
showPublisherPanel(uids:Array = null, width:int = 400, height:int = 350):void
This function shows a dialog containing a preview of a Facebook wall post.
GamerSafe
  
Show registration form.
GamerSafe
  
showScoreboard(scoreboardId:int = -1):void
Shows the requested scoreboard.
GamerSafe
  
showScoreSubmit(score:Number, extra:String, showAsTime:Boolean = false, scoreboardID:int = -1):void
Shows the dialog prompting a user to submit their score, or cancel.
GamerSafe
  
showShop(configuration:Object = null):void
showShop() will display your game's personal store.
GamerSafe
  
showSmallScoreboard(scoreboardId:int = -1):void
Just like showScoreboard, except smaller (275 x 225).
GamerSafe
  
showSmallScoreSubmit(score:Number, extra:String, showAsTime:Boolean = false, scoreboardID:int = -1):void
Just like showScoreSubmit, but smaller.
GamerSafe
  
showStatusBar(configuration:Object = null):void
This function will display the status bar control.
GamerSafe
  
showTwitterPublisher(x:int, y:int, width:int = 400, height:int = 230):void
Like showTwitterPanel but without the dialog frame.
GamerSafe
  
showTwitterPublisherPanel(width:int = 400, height:int = 350):void
This function shows a dialog containing a preview of a Tweet.
GamerSafe
  
tryAutoLogin():void
If you set autoLogin to FALSE, you can call this function to attempt to log in using saved credentials at any time.
GamerSafe
  
twitterConfigure(hashtag:String, url:String):void
Use this function to configure attachments for twitterPost.
GamerSafe
  
Use this function to pop up the GamerSafe Twitter Login screen in a new window.
GamerSafe
  
twitterPost(text:String, useUrl:Boolean = false):void
This function lets you post to Twitter as the logged in user.
GamerSafe
Public Constants
 ConstantDefined by
  EVT_ACCOUNT_CHANGE : String = "account_change"
[static]
GamerSafe
  EVT_AUTO_LOGIN_FAILED : String = "auto_login_failed"
[static]
GamerSafe
  EVT_AVATAR_FETCHED : String = "avatar_fetched"
[static]
GamerSafe
  EVT_BEGIN_SESSION : String = "begin_session"
[static]
GamerSafe
  EVT_BEGIN_SESSION_FAILED : String = "begin_session_failed"
[static]
GamerSafe
  EVT_BRIDGE_ERROR : String = "bridge_error"
[static]
GamerSafe
  EVT_BRIDGE_SUCCESS : String = "bridge_success"
[static]
GamerSafe
  EVT_CONSUMPTION_COMPLETED : String = "consumption_completed"
[static]
GamerSafe
  EVT_FACEBOOK_CONNECTED : String = "fb_connected"
[static]
GamerSafe
  EVT_FACEBOOK_GOT_FRIENDS : String = "fb_got_friends"
[static]
GamerSafe
  EVT_FACEBOOK_GOT_USER : String = "fb_got_user"
[static]
GamerSafe
  EVT_FACEBOOK_LOGIN_FAILED : String = "fb_login_failed"
[static]
GamerSafe
  EVT_FACEBOOK_PROMPT_CLOSED : String = "fb_prompt_closed"
[static]
GamerSafe
  EVT_FACEBOOK_WALL_POST_FAILED : String = "fb_wallpost_fail"
[static]
GamerSafe
  EVT_FACEBOOK_WALL_POST_SUCCESS : String = "fb_wallpost_success"
[static]
GamerSafe
  EVT_INUSE_CHANGED : String = "inUseChanged"
[static]
GamerSafe
  EVT_INUSE_ENDED : String = "inUseEnded"
[static]
GamerSafe
  EVT_INUSE_STARTED : String = "inUseStarted"
[static]
GamerSafe
  EVT_ITEM_PURCHASE : String = "item_purchase"
[static]
GamerSafe
  EVT_ITEM_PURCHASE_CANCELED : String = "item_purchase_canceled"
[static]
GamerSafe
  EVT_ITEM_PURCHASE_FAILED : String = "item_purchase_failed"
[static]
GamerSafe
  EVT_LEVELVAULT_GOT_INDEX : String = "got_index"
[static]
GamerSafe
  EVT_LEVELVAULT_GOT_LEVEL_RANKING : String = "got_level_ranking"
[static]
GamerSafe
  EVT_LEVELVAULT_GOT_LEVELS : String = "got_levels"
[static]
GamerSafe
  EVT_LEVELVAULT_GOT_NUM_LEVELS : String = "got_num_levels"
[static]
GamerSafe
  EVT_LEVELVAULT_GOT_SINGLE_LEVEL : String = "got_level"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_CREATED : String = "level_created"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_DELETED : String = "level_deleted"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_EDITED : String = "level_edited"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_FLAGGED : String = "level_flagged"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTED : String = "level_numerics_incremented"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_NUMERICS_SET : String = "level_numerics_set"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_RATED : String = "level_rated"
[static]
GamerSafe
  EVT_LEVELVAULT_LEVEL_STRINGS_SET : String = "level_strings_set"
[static]
GamerSafe
  EVT_LOGIN : String = "login"
[static]
GamerSafe
  EVT_LOGIN_FAILED : String = "login_failed"
[static]
GamerSafe
  EVT_LOGIN_FORM_CLOSED : String = "login_close"
[static]
GamerSafe
  EVT_NETWORKING_ERROR : String = "networking_error"
[static]
GamerSafe
  EVT_OTHER_GAME_PROFILE_RECEIVED : String = "other_game_profile_received"
[static]
GamerSafe
  EVT_PAYMENT_PANEL_HIDDEN : String = "payment_panel_hidden"
[static]
GamerSafe
  EVT_PAYMENT_PANEL_SHOWN : String = "payment_panel_shown"
[static]
GamerSafe
  EVT_REGISTRATION_FORM_CLOSED : String = "register_close"
[static]
GamerSafe
  EVT_SCOREBOARD_ENTRIES_ERROR : String = "scoreboard_entries_error"
[static]
GamerSafe
  EVT_SCOREBOARD_ENTRIES_RECEIVED : String = "scoreboard_entries_received"
[static]
GamerSafe
  EVT_SCOREBOARD_ENTRY_SUBMITTED : String = "scoreboard_entry_submitted"
[static]
GamerSafe
  EVT_STATUSBAR_MOUSEOUT : String = "statusbar_mouseout"
[static]
GamerSafe
  EVT_STATUSBAR_MOUSEOVER : String = "statusbar_mouseover"
[static]
GamerSafe
  EVT_TWITTER_CONNECTED : String = "twit_connected"
[static]
GamerSafe
  EVT_TWITTER_GOT_USER : String = "twit_got_user"
[static]
GamerSafe
  EVT_TWITTER_LOGIN_FAILED : String = "twit_login_failed"
[static]
GamerSafe
  EVT_TWITTER_POST_FAILED : String = "twit_post_fail"
[static]
GamerSafe
  EVT_TWITTER_POST_SUCCESS : String = "twit_post_success"
[static]
GamerSafe
  EVT_UNREGISTERED_NAME : String = "unregistered_name"
[static]
GamerSafe
  EVT_USERNAME_FETCHED : String = "username_fetched"
[static]
GamerSafe
  version : String = "01"
[static] This is the client version of the scripts.
GamerSafe
Property detail
accountproperty
account:Object  [read-only]

Use this to access the current user's account object.

Implementation
    public function get account():Object
achievementPopupPositionproperty 
achievementPopupPosition:Point  [read-write]Implementation
    public function get achievementPopupPosition():Point
    public function set achievementPopupPosition(value:Point):void
achievementsproperty 
achievements:Array  [read-only]

Get a list of the achievements. Returns an array of Achievement objects. These should be typecasted to "Object", and then the following properties will be accessible:

Implementation
    public function get achievements():Array
apiproperty 
api:GamerSafe  [read-only]

The api variable allows you to access your instance of GamerSafe from anywhere in your code.
After constructing your GamerSafe object, one of the easiest ways of accessing the API functionality is by using GamerSafe.api. You can access all of the functions that you need by using GamerSafe.api, and because it is static, it can be accessed anywhere from within your code. You MUST initiate one instance of the GamerSafe class using the code provided from the website before trying to access this api variable. If the GamerSafe object has not been initiated then this variable will return null.

Implementation
    public static function get api():GamerSafe
apiLoadedproperty 
apiLoaded:Boolean  [read-only]

Returns true if the API has been initialised by the constructor. If this returns false, you need to call new GamerSafe(stage) - passing the stage or root displayobject in.

Implementation
    public static function get apiLoaded():Boolean
applicationDomainproperty 
applicationDomain:ApplicationDomain  [read-only]Implementation
    public function get applicationDomain():ApplicationDomain
autoLoginproperty 
autoLogin:Boolean  [read-write]

If this is set to FALSE before the session is started, the user will not be automatically logged in to their GamerSafe account. We don't reccomend this, but it may be needed in some cases.

Implementation
    public function get autoLogin():Boolean
    public function set autoLogin(value:Boolean):void

See also

showLogin
countryCodeproperty 
countryCode:String  [read-only]

Retrieves the country code of the user playing the game, based on their IP4 address. This function can return unusual things (like "??" or "" or " ") for some special IP addresses. However, the code will always be two characters or less. Typical codes look like "US" or "CA" (for United States and Canada, respectively).

Implementation
    public function get countryCode():String
facebookFriendsproperty 
facebookFriends:Array  [read-only]

This function returns an array of Objects listing the user's Facebook friends. The array is populated once the onFacebookGotFriends event fires. The array is full of objects, each with two String properties, name and id. Pass the IDs to either facebookWallPost() in the target parameter, or to facebookGetPicture().

Implementation
    public function get facebookFriends():Array
facebookLocalUserproperty 
facebookLocalUser:Object  [read-only]

This function returns an object containing information about the currently logged in user. This object is populated once the onFacebookGotLocalUser event fires. The contents of this object can vary widely due to Facebook privacy settings.

Implementation
    public function get facebookLocalUser():Object
facebookLocalUserIdproperty 
facebookLocalUserId:int  [read-only]

Returns the Facebook user ID for the current user.

Implementation
    public function get facebookLocalUserId():int
facebookLoggedInproperty 
facebookLoggedIn:Boolean  [read-only]

This function will let you know if the user is currently logged in to Facebook.

Implementation
    public function get facebookLoggedIn():Boolean
failedproperty 
failed:Boolean  [read-only]

Returns true if something went wrong.

Implementation
    public function get failed():Boolean
FAQUrlproperty 
FAQUrl:String  [read-only]

The FAQ URL is the most up-to-date GamerSafe user FAQ. This URL will change between executions of your game so you must not hard-code it.

Implementation
    public function get FAQUrl():String
gameAuthCodeproperty 
gameAuthCode:String  [read-only]

Used with PlayerIO QuickConnect. Returns this game's passcode.

Implementation
    public function get gameAuthCode():String
gamerGoldproperty 
gamerGold:uint  [read-only]

This variable will return the current user's balance, in GamerGold.

Implementation
    public function get gamerGold():uint
gamerPointsproperty 
gamerPoints:uint  [read-only]

This variable will return the current user's balance, in GamerPoints.

Implementation
    public function get gamerPoints():uint
gamerTestModeproperty 
gamerTestMode:Boolean  [read-only]

This variable will return whether the logged-in user is a test account. Test accounts can only log in while your game is set to "inactive" on the GamerSafe website.

Implementation
    public function get gamerTestMode():Boolean
gamerXPproperty 
gamerXP:uint  [read-only]

This variable will return the XP of the current user. "XP" is a sum of the total GamerPoints ever achieved by this user.

Implementation
    public function get gamerXP():uint
highScoreproperty 
highScore:Number  [read-write]

Gets the current highscore as a number.

Implementation
    public function get highScore():Number
    public function set highScore(value:Number):void
iconUrlproperty 
iconUrl:String  [read-only]

The iconURL is a location where your game's achievement and item icons can be accessed from the web. To find the complete URL, append the item or achievement's "iconName" variable to the iconUrl. Note that this URL will change between executions of your game so you must not hard-code it into your application.

Implementation
    public function get iconUrl():String
inSessionproperty 
inSession:Boolean  [read-only]

inSession will be set to "True" if you are currently connected to GamerSafe. Connecting happens automatically once the API has been downloaded. You can listen for the event begin_session or begin_session_failed to create actions which you would like to be executed as soon as the session has started.

Implementation
    public function get inSession():Boolean

See also

onBeginSession
onBeginSessionFailed
inUseproperty 
inUse:Boolean  [read-only]

You can use the inUse variable to determine whether your player is currently using the GamerSafe components or not. Your game should be paused if "inUse" is true during gameplay, as it means that the user is doing things with our components. Also, if your game hides the mouse, when inUse is true, you should show the mouse cursor. You can detect when inUse changes by listening on any of the following events:

Implementation
    public function get inUse():Boolean
isGamerGoldPurchaseDisabledproperty 
isGamerGoldPurchaseDisabled:Boolean  [read-only]

Returns true if the current portal the game is on disallows GamerGold purchases. In this case, items that cost Gamer Gold will not be displayed in the shop. However, if they were purchased by the user on some other portal site, they will still work.

Implementation
    public function get isGamerGoldPurchaseDisabled():Boolean
itemsproperty 
items:Array  [read-only]

Get a list of all items. Returns an array of Items. These should be typecasted to "Object", and then the following properties will be accessible:

Implementation
    public function get items():Array
latestItemConsumptionInfoproperty 
latestItemConsumptionInfo:Object  [read-only]

Retrieve information about the last item-consumption attempt by the user during this session. The returned Object contains at least these members: itemID (the ID of the item that was attempted to be consumed) desiredQuantityToConsume (how many you tried to consume) actualQuantityConsumed (how many were REALLY consumed; can be lower than desired quantity!)

Implementation
    public function get latestItemConsumptionInfo():Object
latestItemPurchaseInfoproperty 
latestItemPurchaseInfo:Object  [read-only]

Retrieve information about the last item-purchase attempt by the user during this session. The returned Object contains at least the following four members: itemID (the ID of the item being purchased), priceID (the ID of the Price object the user bought the item at), isSuccessful (true if purchase actually happened), reason (set to some English string if purchase was not successful)

Implementation
    public function get latestItemPurchaseInfo():Object
latestOtherGameProfileproperty 
latestOtherGameProfile:Object  [read-only]

The results of the latest call to requestOtherGameProfile. See that function for an example of usage.

Implementation
    public function get latestOtherGameProfile():Object
latestScoreboardEntriesproperty 
latestScoreboardEntries:Object  [read-only]

You should get object when the EVT_SCOREBOARD_ENTRIES_RECEIVED event fires. null will be returned if the GamerSafe API isn't loaded, or if you haven't requested the scoreboard entries. The returned object will have the following structure: var scoreboard_id:int; var daily:Array; // Array of scores for today var weekly:Array; // Array of scores for this week var monthly:Array; // Array of scores for this month var all:Array; // All scores, ever.

Implementation
    public function get latestScoreboardEntries():Object
levelVaultLastCreatedLevelIDproperty 
levelVaultLastCreatedLevelID:uint  [read-only]

Returns the internal level ID of the last level created in the LV by this client.

Implementation
    public function get levelVaultLastCreatedLevelID():uint
levelVaultLastEditedLevelIDproperty 
levelVaultLastEditedLevelID:uint  [read-only]Implementation
    public function get levelVaultLastEditedLevelID():uint
levelVaultLastErrorproperty 
levelVaultLastError:String  [read-only]

The last error that the level vault interface has encountered.

Implementation
    public function get levelVaultLastError():String
levelVaultLastSelectedLevelsReceiptproperty 
levelVaultLastSelectedLevelsReceipt:int  [read-only]Implementation
    public function get levelVaultLastSelectedLevelsReceipt():int
levelVaultReadyproperty 
levelVaultReady:Boolean  [read-only]

The level vault becomes ready shortly before you get the beginSession event. If this is false, check for an error.

Implementation
    public function get levelVaultReady():Boolean
levelVaultShareCookieproperty 
levelVaultShareCookie:String  [read-only]Implementation
    public function get levelVaultShareCookie():String
loadedproperty 
loaded:Boolean  [read-only]

The loaded variable will return 'true' when the API has succesfully been downloaded from the GamerSafe servers

Implementation
    public function get loaded():Boolean
loggedInproperty 
loggedIn:Boolean  [read-only]

The loggedIn variable will be set to TRUE after a user has succesfully logged in. You can listen for the events login and login_failed

Implementation
    public function get loggedIn():Boolean

See also

onLogin
onLoginFailed
partnerproperty 
partner:String  [write-only]

Partner/sponsor stuff

Implementation
    public function set partner(value:String):void
paymentUrlproperty 
paymentUrl:String  [read-only]

The payment URL is the web page to show users that want to add GamerGold to their account. This URL will change between executions of your game so you must not hard-code it.

Implementation
    public function get paymentUrl():String
savedGameproperty 
savedGame:String  [read-write]

Returns the current saved game, or an empty string if you've never set the savedGame. The savedGame is a per-game, per-player string that automatically serializes itself whenever the player is logged in. It has no predetermined format; you can make up whatever format you want to save your game data in.

Implementation
    public function get savedGame():String
    public function set savedGame(value:String):void
signupUrlproperty 
signupUrl:String  [read-only]

The signup URL is the web page to show users that want to sign up for GamerSafe. This URL will change between executions of your game so you must not hard-code it.

Implementation
    public function get signupUrl():String
startingTimeproperty 
startingTime:Date  [read-only]

Retrieves the time the game connected to GamerSafe, in GMT. This is the time the server reported, not the time the client marked. Thus, it can be more accurate than the client time because players could randomly change their computer's clock. Returns null if not yet connected to GamerSafe!

Implementation
    public function get startingTime():Date
statusproperty 
status:String  [read-only]

The status variable allows you to determine the current status of the API. This can be any of the following:

Implementation
    public function get status():String
twitterLoggedInproperty 
twitterLoggedIn:Boolean  [read-only]

This function will let you know if the user is currently logged in to Twitter.

Implementation
    public function get twitterLoggedIn():Boolean
twitterUserproperty 
twitterUser:XML  [read-only]

Returns the Twitter user data for the current user.

Implementation
    public function get twitterUser():XML
unregisteredNameproperty 
unregisteredName:String  [read-only]

Gets the unregistered name. You should call the requestUnregisteredName function, then get this value from within the event listener for the event EVT_UNREGISTERED_NAME

Implementation
    public function get unregisteredName():String
userAuthKeyproperty 
userAuthKey:String  [read-only]

Used with PlayerIO QuickConnect. Returns the logged in user's authentication key.

Implementation
    public function get userAuthKey():String
usernameproperty 
username:String  [read-only]

Use this to access the current user's username.

Implementation
    public function get username():String
wantsNewsletterproperty 
wantsNewsletter:Boolean  [read-write]

The "wantsNewsletter" boolean is intended to be connected to a check-box widget in your game. The idea is that you show a checkbox labeled "Yes! Sign me up for your newsletter!" or something similar. If users click this box, you can set wantsNewsletter to true. If they unclick it, set wantsNewsletter to false. This value is automatically saved as soon as a user is logged in. Please note that there is no way to RETRIEVE the actual email addresses of people who have signed up for your "newsletter", except by talking to administrators. You must make prior arrangements with the GamerSafe administrative staff in order to use this feature; we will then organize a method to give you the mailing list or to send out email on your behalf. Among other things, we will need to be able to verify that your game implements the checkbox in a non-abusive way. The checkbox must default to OFF, not ON, meaning that users must "opt in" to your newsletter, not "opt out" of it. The "newsletter" can actually be any sort of mailing list you want -- just as long as you explain to users when and how often they will receive email from you.

Implementation
    public function get wantsNewsletter():Boolean
    public function set wantsNewsletter(value:Boolean):void
Constructor detail
GamerSafe()constructor
public function GamerSafe(parent:*, passcode:String = null, hashseed:String = null, isAir:Boolean = false)

GamerSafe constructor.
Important Note: You must only create one instance of the GamerSafe object in your project. If you try to create a second instance, it will not initiate properly and a message will be logged to the output console (trace())

Parameters
parent:* — It is imperative that the parent object that you pass to the GamerSafe constructor is either Sprite, MovieClip or Stage.
 
passcode:String (default = null) — The game's passcode, available on the website.
 
hashseed:String (default = null) — The game's hashseed, also available on the website.
 
isAir:Boolean (default = false) — If you want to build the game for Adobe AIR, set this to true.
Method detail
bestowAchievement()method
public function bestowAchievement(achievementId:uint):Boolean

bestowAchievement is the function that you call to give an achievement to the currently logged in user. Your Achievement IDs can be obtained from the GamerSafe, along with auto-generated code to help you. You can call this function as soon as the GamerSafe session has begun. You do NOT need to wait for the user to log in before bestowing achievements.

Parameters
achievementId:uint

Returns
Boolean
bestowFreeItem()method 
public function bestowFreeItem(itemID:int):Boolean

bestowFreeItem will instantly and silently grant the user an item. The item must be free -- that is, it must not cost any GamerPoints or GamerGold. You typically use this to give out free items for winning the game or achieving certain goals. You can call this function as soon as the GamerSafe session has begun. You do NOT need to wait for the user to log in before bestowing free items.

Parameters
itemID:int

Returns
Boolean
closeItemInterface()method 
public function closeItemInterface():void

Closes the currently open 'buy item' interface.

closeScoreboard()method 
public function closeScoreboard():void

Close the open scoreboard dialog

closeShop()method 
public function closeShop():void

Manually hides the Shop interface. Normally, a user will do this by clicking the "X" in the upper right corner.

configureView()method 
public function configureView(config:Object):void

Establishes a default configuration for all the GS UI windows, see the main class comments for the various values that can be set. Useful for smaller size games.

Parameters
config:Object
consumeItem()method 
public function consumeItem(itemId:int, numToConsume:int):void

Attempts to "consume" a consumable item. This may or may not work... you have to wait for the event to come back from the server to see. (The event is "consumption_completed", you can catch that event or assign a function to onConsumptionCompleted to intercept this event.) When you intercept the event, you can call getLatestItemConsumptionInfo() to see the results of how it went. Please do NOT assume that this function automatically works, because there are special conditions where the player could abuse this. For instance, if the player plays your game on two computers at the same time, using the same GamerSafe account, they might consume items in one version of the game and try to consume them in the other as well! To keep players from scamming you (and us), you must wait for the event to see how many consumptions actually happened. Consumable items can have any number of "consumptions" on a single item. For instance, a player could buy one item that is "5 Plays of a MiniGame". They can then consume this item five times to play the mini-game 5 times. You shouldn't use this for very small purchases, because the bookkeeping is very tedious to the user (and the server!). For instance, users will see EVERY item purchase in their purchase logs... so if you sell e.g. "1 Bullet for 1 GamerPoint", and make the player buy 5000 bullets, the poor player will have hundreds of pages of purchase logs to wade through! This will not make them happy. Here's the rule of thumb: you should expect a player not to want to buy more than four or five copies of any given consumable item. (Some crazy players might buy more, but for most players, that should be enough.)

Parameters
itemId:int
 
numToConsume:int
disable()method 
public function disable():void

Disable the API. This will stop gamersafe from processing any requests. Use enable() to re-enable the API.

enable()method 
public function enable():void

Re-enables the API if it's been disabled using the disable() function.

facebookConfigureAttachment()method 
public function facebookConfigureAttachment(name:String, caption:String = null, description:String = null, link:String = null, picture:String = null):void

Use this function to configure an attachment for facebookWallPost. This is where you should put content about your game, not in the text of the wall post. See the facebook developer wiki for more info.

Parameters
name:String — The top line of your attachment, bold and blue and linked to the URI. ex: {Name} just got {Achievement} in {Game}!
 
caption:String (default = null) — The second line of your attachment, typically the name of the game.
 
description:String (default = null) — The remaining text of the attachment, anything else you want to add.
 
link:String (default = null) — A URI that is linked on the name of your attachment.
 
picture:String (default = null) — A URI that usually leads to an image file. Can also link to a video or SWF file.
facebookConnect()method 
public function facebookConnect(requireLogin:Boolean = false):void

Use this function to pop up the GamerSafe Facebook Login screen in a new window. Note that the user may already be logged in to Facebook when the GamerSafe session starts. Use the onFacebookConnected handler to receive notification that they've finished the login process.

Relevant Events:

Parameters
requireLogin:Boolean (default = false) — If set to true, users are required to register for gamersafe in order to use Facebook.
facebookGetPicture()method 
public function facebookGetPicture(uid:String = "me"):URLRequest

This function returns an URLRequest that will load the profile picture of a Facebook user (from the facebookFriends array).

Parameters
uid:String (default = "me") — The Facebook user ID whose picture you want.

Returns
URLRequest — An URLRequest properly formed with attached access token.
facebookWallPost()method 
public function facebookWallPost(text:String, target:String = "me"):void

This function lets you write to a Facebook wall as the logged in user. You should always prompt the user before calling this function, and you must not pre-populate the "text" field for them. The onFacebookWallPostSuccess or the onFacebookWallPostFailed event will fire shortly after you call this function.

Parameters
text:String — A message entered by the user.
 
target:String (default = "me") — A facebook user ID, indicating whose wall to write on. By default, the logged in user's wall.
fetchAvatars()method 
public function fetchAvatars(uids:Array = null):Array

This function is useful with the LevelVault, so that you can fetch the avatars of account creators. Send it an array of account IDs, and it will return an array of all usernames fetched to date, keyed to their IDs. Since the avatars have to be fetched from the server, you should also listen for the EVT_AVATAR_FETCHED event and call this function again to get the new names.

Parameters
uids:Array (default = null) — GamerSafe user IDs to look for.

Returns
Array
fetchUsernames()method 
public function fetchUsernames(uids:Array = null):Array

This function is useful with the LevelVault, so that you can fetch the names of account creators. Send it an array of account IDs, and it will return an array of all usernames fetched to date, keyed to their IDs. Since the usernames have to be fetched from the server, you should also listen for the EVT_USERNAME_FETCHED event and call this function again to get the new names.

Parameters
uids:Array (default = null) — GamerSafe user IDs to look for.

Returns
Array
flashBar()method 
public function flashBar():void

Makes the GamerSafe status bar flash.

getAchievementSkin()method 
public function getAchievementSkin():Object

Returns the current Achievement popup style settings.

Returns
Object
getAvatar()method 
public function getAvatar(uid:uint):String

This function is like fetchAvatars except it will never call the server. It only takes one ID as a parameter and returns the avatar for that ID if it is already cached from a call to fetchAvatars.

Parameters
uid:uint

Returns
String
getConsumptionsAvailable()method 
public function getConsumptionsAvailable(itemId:int):int

Retrieves the number of "consume"s a given item has. This value is meaningless if the item isn't set to be consumable!

Parameters
itemId:int

Returns
int
getItemById()method 
public function getItemById(item_id:int):Object

Get a specific item from it's item ID. This function will return either an item object (see items), or null. It will return null if the API is not yet loaded, or if the object cannot be found. You should always check to see if the item returned is null before attempting to access any of it's variables or functions or your code may throw an error.

Parameters
item_id:int

Returns
Object
getSavedGame()method 
public function getSavedGame(idx:int = 0):String

Returns a saved game. Currently only two are available.
getSavedGame(0) would be the same as the savedGame getter.
getSavedGame(1) is the new secondary saved game.
Anything else will return null.

Parameters
idx:int (default = 0)

Returns
String
getSkin()method 
public function getSkin():Object

Returns the current global style settings.

Returns
Object
getUsername()method 
public function getUsername(uid:uint):String

This function is like fetchUsernames except it will never call the server. It only takes one ID as a parameter and returns the username for that ID if it is already cached from a call to fetchUsernames.

Parameters
uid:uint

Returns
String
hasAchievement()method 
public function hasAchievement(achievementId:int):Boolean

You can use this function to check wether the user has had an achievement bestowed to them or not.

Parameters
achievementId:int — The ID of the achievement to check. This can be found on the GamerSafe website.

Returns
Boolean

See also

showAchievements
bestowAchievement
achievements
hasItem()method 
public function hasItem(itemId:int):Boolean

You can use this function to check wether the user owns the item queried. If the user does not own the item, FALSE will be returned, if they have 1 or more of the item, TRUE will be returned.

Parameters
itemId:int — The ID of the item to check. This can be found on the GamerSafe website.

Returns
Boolean

See also

showShop
items
hideFriendsList()method 
public function hideFriendsList():void

Hides the friends list control when you're done with it.

hideInterface()method 
public function hideInterface():void

Completely hides the GamerSafe UI and all of its children.

hidePublisher()method 
public function hidePublisher():void

Hides the publisher control when you're done with it.

hideShopButton()method 
public function hideShopButton(disable:Boolean = true):void

hideShopButton() will allow you to disappear the shop button on the status bar. You can still show and hide the shop through your code, this just keeps them from opening it through ours.

Parameters
disable:Boolean (default = true)
hideStatusBar()method 
public function hideStatusBar():void

hideStatusBar() will completley remove the status bar from the screen. You may want to call this function whilst the user is playing on a level in your game, however it is unintrusive, so it may be desirable to display it during gameplay in some cases.

hideTwitterPublisher()method 
public function hideTwitterPublisher():void

Hides the publisher control when you're done with it.

levelVaultCreateLevel()method 
public function levelVaultCreateLevel(levelData:*):Boolean

This function will create a new Level in the LV. It's suggested you use ByteArrays for binary data. Otherwise, your object will be packed into a ByteArray with the ByteArray.writeObject function.

Parameters
levelData:* — the object you want to save in the LV.

Returns
Boolean
levelVaultCreateLevelFromBytes()method 
public function levelVaultCreateLevelFromBytes(levelData:ByteArray):Boolean

This function will create a new Level in the LV.

Parameters
levelData:ByteArray — the ByteArray you want to save in the LV.

Returns
Boolean
levelVaultCreateLevelFromObject()method 
public function levelVaultCreateLevelFromObject(level:Object):Boolean

This function will create a new Level in the LV.

Parameters
level:Object — this object will be converted to a ByteArray with the ByteArray.writeObject function.

Returns
Boolean
levelVaultCreateLevelWithAttributes()method 
public function levelVaultCreateLevelWithAttributes(levelData:*, attributes:Object):Boolean

Conveniently creates a level and then assigns attributes to it for you once it's made.

Parameters
levelData:* — the object you want to save in the LV.
 
attributes:Object — an object containing the attributes you want to apply to the level.

Returns
Boolean

See also

levelVaultCreateLevel
levelVaultDeleteLevel()method 
public function levelVaultDeleteLevel(levelOrLevelId:*):BooleanParameters
levelOrLevelId:*

Returns
Boolean
levelVaultEditLevel()method 
public function levelVaultEditLevel(levelOrLevelId:*, levelData:ByteArray):Boolean

Updates the data stored for a level.

Parameters
levelOrLevelId:* — the level you'd like to update - if it's a level object we'll pull the relevant ID from it. otherwise, it should be the integer level ID.
 
levelData:ByteArray — the new information to save for that level.

Returns
Boolean
levelVaultFetchLevelByID()method 
public function levelVaultFetchLevelByID(levelId:int):BooleanParameters
levelId:int

Returns
Boolean
levelVaultFlagLevel()method 
public function levelVaultFlagLevel(levelOrLevelId:*):BooleanParameters
levelOrLevelId:*

Returns
Boolean
levelVaultGetAllLevels()method 
public function levelVaultGetAllLevels(ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetAttributeRanking()method 
public function levelVaultGetAttributeRanking(value:int, attribute:String, ascending:Boolean = false):BooleanParameters
value:int
 
attribute:String
 
ascending:Boolean (default = false)

Returns
Boolean
levelVaultGetIndexAdvanced()method 
public function levelVaultGetIndexAdvanced(attributes:Array, order:Array, limit:uint = 20, offset:uint = 0):intParameters
attributes:Array
 
order:Array
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLastIndex()method 
public function levelVaultGetLastIndex():Array

Returns
Array
levelVaultGetLastNumLevels()method 
public function levelVaultGetLastNumLevels():int

Returns
int
levelVaultGetLastRanking()method 
public function levelVaultGetLastRanking():int

Returns
int
levelVaultGetLastSelectedLevel()method 
public function levelVaultGetLastSelectedLevel():Object

Returns
Object
levelVaultGetLastSelectedLevels()method 
public function levelVaultGetLastSelectedLevels():Array

Returns
Array
levelVaultGetLevelAsCustomObject()method 
public function levelVaultGetLevelAsCustomObject(type:Class, level:Object = null):*

This function will attempt to copy the information in the given LV object into a new instance of the type you pass. This is just a convenience function. It will return an object of the type you pass, but it may be Null.

Parameters
type:Class
 
level:Object (default = null)

Returns
*
levelVaultGetLevelAsObject()method 
public function levelVaultGetLevelAsObject(level:Object = null):Object

This will use the ByteArray.readObject() function to create an object from the level data you pass it. If you call it without a level parameter, or with null, it will attempt to cast the level data from the most recently selected level.

Parameters
level:Object (default = null)

Returns
Object
levelVaultGetLevelAttributes()method 
public function levelVaultGetLevelAttributes(level:Object = null):ArrayParameters
level:Object (default = null)

Returns
Array
levelVaultGetLevelData()method 
public function levelVaultGetLevelData(level:Object = null):ByteArrayParameters
level:Object (default = null)

Returns
ByteArray
levelVaultGetLevelID()method 
public function levelVaultGetLevelID(level:Object = null):uintParameters
level:Object (default = null)

Returns
uint
levelVaultGetLevelNumRatings()method 
public function levelVaultGetLevelNumRatings(level:Object = null):intParameters
level:Object (default = null)

Returns
int
levelVaultGetLevelRanking()method 
public function levelVaultGetLevelRanking(levelId:int, attribute:String, ascending:Boolean = false):BooleanParameters
levelId:int
 
attribute:String
 
ascending:Boolean (default = false)

Returns
Boolean
levelVaultGetLevelRating()method 
public function levelVaultGetLevelRating(level:Object = null):NumberParameters
level:Object (default = null)

Returns
Number
levelVaultGetLevelsAdvanced()method 
public function levelVaultGetLevelsAdvanced(attributes:Array, order:Array, limit:uint = 20, offset:uint = 0):intParameters
attributes:Array
 
order:Array
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsByDateCreated()method 
public function levelVaultGetLevelsByDateCreated(start_date:String, end_date:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
start_date:String
 
end_date:String
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsByDateModified()method 
public function levelVaultGetLevelsByDateModified(start_date:String, end_date:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
start_date:String
 
end_date:String
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsByNumericData()method 
public function levelVaultGetLevelsByNumericData(key:String, min:Number, max:Number, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
key:String
 
min:Number
 
max:Number
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsByRating()method 
public function levelVaultGetLevelsByRating(min_rating:Number, max_rating:Number, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
min_rating:Number
 
max_rating:Number
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsByStringData()method 
public function levelVaultGetLevelsByStringData(key:String, value:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
key:String
 
value:String
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsLike()method 
public function levelVaultGetLevelsLike(key:String, value:String, ascending:Boolean = true, limit:uint = 20, offset:uint = 0):intParameters
key:String
 
value:String
 
ascending:Boolean (default = true)
 
limit:uint (default = 20)
 
offset:uint (default = 0)

Returns
int
levelVaultGetLevelsRandom()method 
public function levelVaultGetLevelsRandom(count:uint):intParameters
count:uint

Returns
int
levelVaultGetNumLevels()method 
public function levelVaultGetNumLevels():uint

Returns
uint
levelVaultGetNumLevelsAdvanced()method 
public function levelVaultGetNumLevelsAdvanced(attributes:Array):intParameters
attributes:Array

Returns
int
levelVaultIncrementNumeric()method 
public function levelVaultIncrementNumeric(levelOrLevelId:*, key:String):BooleanParameters
levelOrLevelId:*
 
key:String

Returns
Boolean
levelVaultIncrementNumerics()method 
public function levelVaultIncrementNumerics(levelOrLevelId:*, keys:Array):BooleanParameters
levelOrLevelId:*
 
keys:Array

Returns
Boolean
levelVaultRateLevel()method 
public function levelVaultRateLevel(levelOrLevelId:*, rating:uint):BooleanParameters
levelOrLevelId:*
 
rating:uint

Returns
Boolean
levelVaultRegisterCallback()method 
public function levelVaultRegisterCallback(callback:Function, ... args):voidParameters
callback:Function
 
... args
levelVaultRegisterErrorCallback()method 
public function levelVaultRegisterErrorCallback(callback:Function, ... args):voidParameters
callback:Function
 
... args
levelVaultRegisterPersistentErrorCallback()method 
public function levelVaultRegisterPersistentErrorCallback(callback:Function, ... args):voidParameters
callback:Function
 
... args
levelVaultSetAttributes()method 
public function levelVaultSetAttributes(levelOrLevelId:*, attributes:Object):BooleanParameters
levelOrLevelId:*
 
attributes:Object

Returns
Boolean
levelVaultSetExpiringNumericAttribute()method 
public function levelVaultSetExpiringNumericAttribute(levelOrLevelId:*, key:String, value:Number, expires:String):BooleanParameters
levelOrLevelId:*
 
key:String
 
value:Number
 
expires:String

Returns
Boolean
levelVaultSetExpiringNumericAttributes()method 
public function levelVaultSetExpiringNumericAttributes(levelOrLevelId:*, keys:Array, data:Array, expires:Array):BooleanParameters
levelOrLevelId:*
 
keys:Array
 
data:Array
 
expires:Array

Returns
Boolean
levelVaultSetExpiringStringAttribute()method 
public function levelVaultSetExpiringStringAttribute(levelOrLevelId:*, key:String, value:String, expires:String):BooleanParameters
levelOrLevelId:*
 
key:String
 
value:String
 
expires:String

Returns
Boolean
levelVaultSetExpiringStringAttributes()method 
public function levelVaultSetExpiringStringAttributes(levelOrLevelId:*, keys:Array, data:Array, expires:Array):BooleanParameters
levelOrLevelId:*
 
keys:Array
 
data:Array
 
expires:Array

Returns
Boolean
levelVaultSetNumericAttribute()method 
public function levelVaultSetNumericAttribute(levelOrLevelId:*, key:String, value:Number):BooleanParameters
levelOrLevelId:*
 
key:String
 
value:Number

Returns
Boolean
levelVaultSetNumericAttributes()method 
public function levelVaultSetNumericAttributes(levelOrLevelId:*, keys:Array, data:Array):BooleanParameters
levelOrLevelId:*
 
keys:Array
 
data:Array

Returns
Boolean
levelVaultSetStringAttribute()method 
public function levelVaultSetStringAttribute(levelOrLevelId:*, key:String, value:String):BooleanParameters
levelOrLevelId:*
 
key:String
 
value:String

Returns
Boolean
levelVaultSetStringAttributes()method 
public function levelVaultSetStringAttributes(levelOrLevelId:*, keys:Array, data:Array):BooleanParameters
levelOrLevelId:*
 
keys:Array
 
data:Array

Returns
Boolean
levelVaultSwitchGame()method 
public function levelVaultSwitchGame(passcode:String = ""):Boolean

Have you ever wanted to access the LV data for another game from this one? Go for it! Use with extreme caution.

Parameters
passcode:String (default = "") — the GamerSafe passcode for the other game.

Returns
Boolean
login()method 
public function login(username:String, password:String, rememberMe:Boolean = false):void

This function allows you to log a specified user in. It can be used to make your own Log-in interface, or it can be called with hardcoded credentials to log in a test account for First Impressions/FGL use.

Parameters
username:String
 
password:String
 
rememberMe:Boolean (default = false)
logout()method 
public function logout():void

"Logging out" causes the system to stop trying to re-log-in the user. This "logs them out of GamerSafe". However, this doesn't log the user out of YOUR GAME (so if you call GamerSafe functions, they will still work). To emulate the latter behavior, stop calling GamerSafe functions after the user to logs out.

purchaseItem()method 
public function purchaseItem(itemID:int, priceID:int = 0):Boolean

purchaseItem will cause a given item to be purchased. Listen for the 'item_purchase' and 'item_purchase_failed' events to know when the purchase completes. The user must be logged in. You can provide a price ID, but since currently all items have a single price, this is redundant -- just pass 0 to use the default (and only) price of the item.

Parameters
itemID:int
 
priceID:int (default = 0)

Returns
Boolean
purchaseItemInterface()method 
public function purchaseItemInterface(itemId:int, priceID:int = 0):void

Shows the purchase item popup. Can be used to prompt a user to buy a specific item.

Parameters
itemId:int
 
priceID:int (default = 0)
requestOtherGameProfile()method 
public function requestOtherGameProfile(otherGamePasscode:String):void

This is an advanced feature for developers who are writing sequels to an earlier GamerSafe game they have already launched. It lets the game obtain information about how well the player did in that earlier game. Among other things, you can obtain a list of Item IDs and Achievement IDs for items and achievements the player earned. (Those IDs correspond to constants in the GamerSafe.as header file for your earlier game. You'll want to copy-n-paste those earlier game constants into your new game somewhere so you can refer to the IDs by name, instead of by weird numbers.) When the request completes, an EVT_OTHER_GAME_PROFILE_RECEIVED event is fired. You can either set a handler for this in the traditional AS3 format or you can use the convenient function-pointer syntax (as shown in the example below) to intercept this event. If you use an invalid ID (or an ID from a game you don't own, etc.), you will still get this event, but the results will be null. In the event-handler function, use the latestOtherGameProfile variable to get the information about the profile. This is an Object with numerous fields, most of which are undocumented. The ones that are guaranteed to be there are the following: - a variable called "achievementReceipts" which is an array of objects. Each object has a member called "achievement_id" which is the ID of an achievement the player obtained. - a variable called "itemReceipts" which is an array of objects. Each object has a member called "item_id" which is the ID of the item the player earned or purchased. Following is an example of how to request and process this information:

   
   // somewhere in your program, request notification when an "other game profile" event happens
   GamerSafe.api.onOtherGameProfileReceived = onOtherGameProfile;
   ...
   // after user has connected, request data for your game sequel (the string is the "_storedPasscode" 
   // variable from your other games' GamerSafe.as file... the one below is obviously not YOUR game sequel ID, just an example!)
   GamerSafe.api.requestOtherGameProfile("G13b5403fe95ea798c1759f5fc17f06a4b288f92f8:1265667543"); 
   ...
   // when the event comes in, interact with it like so:
   
    private function onOtherGameProfile():void {
    for each (var x:in GamerSafe.api.latestOtherGameProfile.achievementReceipts)
   {
    trace("player earned this achievement ID in other game: " + x.achievement_id);
   }
   for each (var y:in GamerSafe.api.latestOtherGameProfile.itemReceipts)
   {
    trace("player owned this item ID in other game: " + y.item_id);
   }
  }
  
  

Parameters
otherGamePasscode:String
requestScoreboardEntries()method 
public function requestScoreboardEntries(scoreboardID:int = -1):void

Requests an array of the scoreboard entries. Once the entried have been downloaded succefully, a EVT_SCOREBOARD_ENTRIES_RECEIVED event will be triggered.

Parameters
scoreboardID:int (default = -1)
requestUnregisteredName()method 
public function requestUnregisteredName():void

Sends a request to retrieve the unregistered players username, determined by the name that they enter into the scoreboard submission box.

saveToScoreboard()method 
public function saveToScoreboard(score:Number, extra:String, scoreboardID:int = -1, unregistered_name:String = ""):void

Save a score to the scoreboard. "extra" text is displayed on the scoreboard after the score, E.g. "10430 - Great!"

Parameters
score:Number
 
extra:String
 
scoreboardID:int (default = -1)
 
unregistered_name:String (default = "")
setAchievementStyle()method 
public function setAchievementStyle(name:String, value:*):void

setAchievementStyle should be used to set the achievement popup's visual settings. The acceptable values for name are:

Parameters
name:String
 
value:*
setRegistrationDefaults()method 
public function setRegistrationDefaults(defaults:Object):void

Use this function to pre-populate the Register dialog, if you have access to any information about the user. This accepts an object, structured like so: { username: "myUser", email: "myUser

Parameters
defaults:Object
setSavedGame()method 
public function setSavedGame(save:String, idx:int = 0):void

Writes a saved game. Currently only two are available.
setSavedGame("foo", 0); is equivalent to savedGame = "foo";
setSavedGame("bar", 1); is new functionality.

Parameters
save:String — saved game data. Maximum length 10240 bytes.
 
idx:int (default = 0) — which save slot to use. Currently, either 0 or 1 is acceptable.
setShopCategoryVisible()method 
public function setShopCategoryVisible(category:int, visible:Boolean):void

Displays/Hides a category globablly from the shop.

Parameters
category:int
 
visible:Boolean
setStyle()method 
public function setStyle(name:String, value:*):void

setStyle should be used to set the global theme settings. The acceptable values for name are:

Parameters
name:String
 
value:*
showAchievements()method 
public function showAchievements(configuration:Object = null):void

This function will display a window, overlayed onto your game, which contains an organised list of possible Achievements that your players can unlock. You should pause any gameplay before calling this function.

Parameters
configuration:Object (default = null)
showFriendsList()method 
public function showFriendsList(x:int, y:int, width:int = 400, height:int = 350):void

Like showFriendsPanel but without the dialog frame. Use this method if you want to integrate the Friends List UI into your game in some other fashion.

Parameters
x:int — the left edge of the control.
 
y:int — the top of the control.
 
width:int (default = 400) — how wide to make the control.
 
height:int (default = 350) — how tall to make the control.
showFriendsPanel()method 
public function showFriendsPanel(width:int = 400, height:int = 350):void

This function shows a dialog containing a list of Facebook Friends for the logged in user. They can then select one or more and then publish to their walls. You should call facebookConfigureAttachment before you open this interface.

Parameters
width:int (default = 400) — how wide to make the dialog.
 
height:int (default = 350) — how tall to make the dialog.
showFriendsScoreboard()method 
public function showFriendsScoreboard(scoreboardId:int = -1):void

Shows the requested scoreboard, filtered by facebook friends. Scoreboard ID should be passed in, or if you leave it as the default (-1) then the default scoreboard will be loaded.

Parameters
scoreboardId:int (default = -1)
showInterface()method 
public function showInterface():void

Reverses hideInteface().

showLogin()method 
public function showLogin(configuration:Object = null):void

This function will display the login form, overlayed onto your game. You should pause any gameplay before calling this function.

Parameters
configuration:Object (default = null)
showMessageBox()method 
public function showMessageBox(title:String, text:String, isConfirm:Boolean = true):void

showMessageBox allows you to display a GamerSafe-styled message box with a custom message to the player. The messagebox can either have a "Yes/No" selection, or it can have just an "OK" button. You should listen for the events "confirmedYes" and "confirmedNo" which are fired when the user clicks one of the buttons in the popup box. If the box is an "Ok-only" box, then "confirmedYes" will always be fired.

Parameters
title:String — The title text of the message box
 
text:String — The content of the message box, can be multiple lines long.
 
isConfirm:Boolean (default = true) — If set to true, the box will have "Yes/No" buttons. If set to false it will only show "Ok"
showPopup()method 
public function showPopup(text:String, configuration:Object = null):void

shopPopup will show a popup box, overlayed on top of your game. The popup box is unintrusive and will dissapear after around 2 seconds, so it can be displayed at any time - even when a user is playing the game.

Parameters
text:String — The text that is displayed in the popup. Shouldn't be more than 2 lines long.
 
configuration:Object (default = null)
showPublisher()method 
public function showPublisher(x:int, y:int, uids:Array = null, width:int = 400, height:int = 350):void

Like showPublisherPanel but without the dialog frame. Use this method if you want to integrate the Publisher UI into your game in some other fashion.

Parameters
x:int — the left edge of the control.
 
y:int — the top of the control.
 
uids:Array (default = null) — facebook user IDs of walls to post to. null is acceptable, and will post only to the logged in user's wall.
 
width:int (default = 400) — how wide to make the dialog.
 
height:int (default = 350) — how tall to make the dialog.
showPublisherPanel()method 
public function showPublisherPanel(uids:Array = null, width:int = 400, height:int = 350):void

This function shows a dialog containing a preview of a Facebook wall post. The user can see the attachment information and type a comment before they post. Call facebookConfigureAttachment before you open this interface.

Parameters
uids:Array (default = null) — facebook user IDs of walls to post to. null is acceptable, and will post only to the logged in user's wall.
 
width:int (default = 400) — how wide to make the dialog.
 
height:int (default = 350) — how tall to make the dialog.
showRegistrationForm()method 
public function showRegistrationForm():void

Show registration form.

showScoreboard()method 
public function showScoreboard(scoreboardId:int = -1):void

Shows the requested scoreboard. Scoreboard ID should be passed in, or if you leave it as the default (-1) then the default scoreboard will be loaded.

Parameters
scoreboardId:int (default = -1)
showScoreSubmit()method 
public function showScoreSubmit(score:Number, extra:String, showAsTime:Boolean = false, scoreboardID:int = -1):void

Shows the dialog prompting a user to submit their score, or cancel. If the user is not logged in, it will prompt them. to enter in their name or nicknam. extra text is displayed on the scoreboard after the score, E.g. "10430 - Great!"

Parameters
score:Number
 
extra:String
 
showAsTime:Boolean (default = false)
 
scoreboardID:int (default = -1)
showShop()method 
public function showShop(configuration:Object = null):void

showShop() will display your game's personal store. The user can then browse through your items and purchase them with a single click. You should pause any gameplay before calling this function.

Parameters
configuration:Object (default = null)
showSmallScoreboard()method 
public function showSmallScoreboard(scoreboardId:int = -1):void

Just like showScoreboard, except smaller (275 x 225).

Parameters
scoreboardId:int (default = -1)
showSmallScoreSubmit()method 
public function showSmallScoreSubmit(score:Number, extra:String, showAsTime:Boolean = false, scoreboardID:int = -1):void

Just like showScoreSubmit, but smaller. (275x200)

Parameters
score:Number
 
extra:String
 
showAsTime:Boolean (default = false)
 
scoreboardID:int (default = -1)
showStatusBar()method 
public function showStatusBar(configuration:Object = null):void

This function will display the status bar control. We advise you to call this function whenever a menu is displayed, and in-between levels of your game, if applicable.

Parameters
configuration:Object (default = null)
showTwitterPublisher()method 
public function showTwitterPublisher(x:int, y:int, width:int = 400, height:int = 230):void

Like showTwitterPanel but without the dialog frame. Use this method if you want to integrate the Publisher UI into your game in some other fashion.

Parameters
x:int — the left edge of the control.
 
y:int — the top of the control.
 
width:int (default = 400) — how wide to make the dialog.
 
height:int (default = 230) — how tall to make the dialog.
showTwitterPublisherPanel()method 
public function showTwitterPublisherPanel(width:int = 400, height:int = 350):void

This function shows a dialog containing a preview of a Tweet. The user can see the hashtag and URL information and type a comment before they post.

Parameters
width:int (default = 400) — how wide to make the dialog.
 
height:int (default = 350) — how tall to make the dialog.
tryAutoLogin()method 
public function tryAutoLogin():void

If you set autoLogin to FALSE, you can call this function to attempt to log in using saved credentials at any time. If there are no saved credentials, then nothing will happen and nothing will be returned. If there are saved credentials, the login event will be called.

twitterConfigure()method 
public function twitterConfigure(hashtag:String, url:String):void

Use this function to configure attachments for twitterPost. This is where you should set a hashtag for your game, and also a URL. The user is prompted to use the hashtag as they like, but the URL is automatically linked to the end of the tweet.

Parameters
hashtag:String — A #hashtag that the user is prompted to use by the twitterPublisher.
 
url:String — A url that is appended to the end of the tweet, if there is room.
twitterConnect()method 
public function twitterConnect():void

Use this function to pop up the GamerSafe Twitter Login screen in a new window. Note that the user may already be logged in to Twitter when the GamerSafe session starts. Use the onTwitterConnected handler to receive notification that they've finished the login process.

Relevant Events:

twitterPost()method 
public function twitterPost(text:String, useUrl:Boolean = false):void

This function lets you post to Twitter as the logged in user. You should always prompt the user before calling this function, and you must not pre-populate the "text" field for them. The onTwitterPostSuccess or the onTwitterPostFailed event will fire shortly after you call this function.

Parameters
text:String — A message entered by the user.
 
useUrl:Boolean (default = false) — Attach the URL set in configureTwitter to the post.
Constant detail
EVT_ACCOUNT_CHANGEconstant
public static const EVT_ACCOUNT_CHANGE:String = "account_change"
EVT_AUTO_LOGIN_FAILEDconstant 
public static const EVT_AUTO_LOGIN_FAILED:String = "auto_login_failed"
EVT_AVATAR_FETCHEDconstant 
public static const EVT_AVATAR_FETCHED:String = "avatar_fetched"
EVT_BEGIN_SESSIONconstant 
public static const EVT_BEGIN_SESSION:String = "begin_session"
EVT_BEGIN_SESSION_FAILEDconstant 
public static const EVT_BEGIN_SESSION_FAILED:String = "begin_session_failed"
EVT_BRIDGE_ERRORconstant 
public static const EVT_BRIDGE_ERROR:String = "bridge_error"
EVT_BRIDGE_SUCCESSconstant 
public static const EVT_BRIDGE_SUCCESS:String = "bridge_success"
EVT_CONSUMPTION_COMPLETEDconstant 
public static const EVT_CONSUMPTION_COMPLETED:String = "consumption_completed"
EVT_FACEBOOK_CONNECTEDconstant 
public static const EVT_FACEBOOK_CONNECTED:String = "fb_connected"
EVT_FACEBOOK_GOT_FRIENDSconstant 
public static const EVT_FACEBOOK_GOT_FRIENDS:String = "fb_got_friends"
EVT_FACEBOOK_GOT_USERconstant 
public static const EVT_FACEBOOK_GOT_USER:String = "fb_got_user"
EVT_FACEBOOK_LOGIN_FAILEDconstant 
public static const EVT_FACEBOOK_LOGIN_FAILED:String = "fb_login_failed"
EVT_FACEBOOK_PROMPT_CLOSEDconstant 
public static const EVT_FACEBOOK_PROMPT_CLOSED:String = "fb_prompt_closed"
EVT_FACEBOOK_WALL_POST_FAILEDconstant 
public static const EVT_FACEBOOK_WALL_POST_FAILED:String = "fb_wallpost_fail"
EVT_FACEBOOK_WALL_POST_SUCCESSconstant 
public static const EVT_FACEBOOK_WALL_POST_SUCCESS:String = "fb_wallpost_success"
EVT_INUSE_CHANGEDconstant 
public static const EVT_INUSE_CHANGED:String = "inUseChanged"
EVT_INUSE_ENDEDconstant 
public static const EVT_INUSE_ENDED:String = "inUseEnded"
EVT_INUSE_STARTEDconstant 
public static const EVT_INUSE_STARTED:String = "inUseStarted"
EVT_ITEM_PURCHASEconstant 
public static const EVT_ITEM_PURCHASE:String = "item_purchase"
EVT_ITEM_PURCHASE_CANCELEDconstant 
public static const EVT_ITEM_PURCHASE_CANCELED:String = "item_purchase_canceled"
EVT_ITEM_PURCHASE_FAILEDconstant 
public static const EVT_ITEM_PURCHASE_FAILED:String = "item_purchase_failed"
EVT_LEVELVAULT_GOT_INDEXconstant 
public static const EVT_LEVELVAULT_GOT_INDEX:String = "got_index"
EVT_LEVELVAULT_GOT_LEVEL_RANKINGconstant 
public static const EVT_LEVELVAULT_GOT_LEVEL_RANKING:String = "got_level_ranking"
EVT_LEVELVAULT_GOT_LEVELSconstant 
public static const EVT_LEVELVAULT_GOT_LEVELS:String = "got_levels"
EVT_LEVELVAULT_GOT_NUM_LEVELSconstant 
public static const EVT_LEVELVAULT_GOT_NUM_LEVELS:String = "got_num_levels"
EVT_LEVELVAULT_GOT_SINGLE_LEVELconstant 
public static const EVT_LEVELVAULT_GOT_SINGLE_LEVEL:String = "got_level"
EVT_LEVELVAULT_LEVEL_CREATEDconstant 
public static const EVT_LEVELVAULT_LEVEL_CREATED:String = "level_created"
EVT_LEVELVAULT_LEVEL_DELETEDconstant 
public static const EVT_LEVELVAULT_LEVEL_DELETED:String = "level_deleted"
EVT_LEVELVAULT_LEVEL_EDITEDconstant 
public static const EVT_LEVELVAULT_LEVEL_EDITED:String = "level_edited"
EVT_LEVELVAULT_LEVEL_FLAGGEDconstant 
public static const EVT_LEVELVAULT_LEVEL_FLAGGED:String = "level_flagged"
EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTEDconstant 
public static const EVT_LEVELVAULT_LEVEL_NUMERICS_INCREMENTED:String = "level_numerics_incremented"
EVT_LEVELVAULT_LEVEL_NUMERICS_SETconstant 
public static const EVT_LEVELVAULT_LEVEL_NUMERICS_SET:String = "level_numerics_set"
EVT_LEVELVAULT_LEVEL_RATEDconstant 
public static const EVT_LEVELVAULT_LEVEL_RATED:String = "level_rated"
EVT_LEVELVAULT_LEVEL_STRINGS_SETconstant 
public static const EVT_LEVELVAULT_LEVEL_STRINGS_SET:String = "level_strings_set"
EVT_LOGINconstant 
public static const EVT_LOGIN:String = "login"
EVT_LOGIN_FAILEDconstant 
public static const EVT_LOGIN_FAILED:String = "login_failed"
EVT_LOGIN_FORM_CLOSEDconstant 
public static const EVT_LOGIN_FORM_CLOSED:String = "login_close"
EVT_NETWORKING_ERRORconstant 
public static const EVT_NETWORKING_ERROR:String = "networking_error"
EVT_OTHER_GAME_PROFILE_RECEIVEDconstant 
public static const EVT_OTHER_GAME_PROFILE_RECEIVED:String = "other_game_profile_received"
EVT_PAYMENT_PANEL_HIDDENconstant 
public static const EVT_PAYMENT_PANEL_HIDDEN:String = "payment_panel_hidden"
EVT_PAYMENT_PANEL_SHOWNconstant 
public static const EVT_PAYMENT_PANEL_SHOWN:String = "payment_panel_shown"
EVT_REGISTRATION_FORM_CLOSEDconstant 
public static const EVT_REGISTRATION_FORM_CLOSED:String = "register_close"
EVT_SCOREBOARD_ENTRIES_ERRORconstant 
public static const EVT_SCOREBOARD_ENTRIES_ERROR:String = "scoreboard_entries_error"
EVT_SCOREBOARD_ENTRIES_RECEIVEDconstant 
public static const EVT_SCOREBOARD_ENTRIES_RECEIVED:String = "scoreboard_entries_received"
EVT_SCOREBOARD_ENTRY_SUBMITTEDconstant 
public static const EVT_SCOREBOARD_ENTRY_SUBMITTED:String = "scoreboard_entry_submitted"
EVT_STATUSBAR_MOUSEOUTconstant 
public static const EVT_STATUSBAR_MOUSEOUT:String = "statusbar_mouseout"
EVT_STATUSBAR_MOUSEOVERconstant 
public static const EVT_STATUSBAR_MOUSEOVER:String = "statusbar_mouseover"
EVT_TWITTER_CONNECTEDconstant 
public static const EVT_TWITTER_CONNECTED:String = "twit_connected"
EVT_TWITTER_GOT_USERconstant 
public static const EVT_TWITTER_GOT_USER:String = "twit_got_user"
EVT_TWITTER_LOGIN_FAILEDconstant 
public static const EVT_TWITTER_LOGIN_FAILED:String = "twit_login_failed"
EVT_TWITTER_POST_FAILEDconstant 
public static const EVT_TWITTER_POST_FAILED:String = "twit_post_fail"
EVT_TWITTER_POST_SUCCESSconstant 
public static const EVT_TWITTER_POST_SUCCESS:String = "twit_post_success"
EVT_UNREGISTERED_NAMEconstant 
public static const EVT_UNREGISTERED_NAME:String = "unregistered_name"
EVT_USERNAME_FETCHEDconstant 
public static const EVT_USERNAME_FETCHED:String = "username_fetched"
versionconstant 
public static const version:String = "01"

This is the client version of the scripts. You will not need to access it, and it cannot be modified.