Flash ActionScript 3.0 Promotion Library
From ePrize Developers Wiki
Line 1: | Line 1: | ||
+ | |||
We distribute the Flash library as an MXP so it's easy to drag and drop the com.eprize.api.Promo class onto the stage. Once an instance is on the stage, use Flash's attribute editor to name the instance "promo" and set the hostname and apiKey attributes. After that's done, the following methods can be called. | We distribute the Flash library as an MXP so it's easy to drag and drop the com.eprize.api.Promo class onto the stage. Once an instance is on the stage, use Flash's attribute editor to name the instance "promo" and set the hostname and apiKey attributes. After that's done, the following methods can be called. | ||
+ | |||
== promo.login(email) == | == promo.login(email) == |
Revision as of 22:55, 2 March 2009
We distribute the Flash library as an MXP so it's easy to drag and drop the com.eprize.api.Promo class onto the stage. Once an instance is on the stage, use Flash's attribute editor to name the instance "promo" and set the hostname and apiKey attributes. After that's done, the following methods can be called.
Contents |
promo.login(email)
Attempt to login as the profile registered with the given email. If this succeeds, getRegField() may be used to fetch values from the profile, but only those values that are marked safe in the profile.
promo.setRegField(key, value)
Set the value of a registration field prior to calling register(). If the same key is set twice, the second value replaces the first.
promo.getRegField(key)
Get the value of a registration field after login(), setRegField() or register().
promo.register()
Register a new profile. If this succeeds, the effect is the same as calling login().
promo.playGame()
Call after successful login() or register(). This method will automatically find the first available game play and return the win or lose status.
promo.tellFriend(friendName, friendEmail)
Call after successful login() or register() to send an email to a friend.