Flash ActionScript 3.0 Promotion Library

From ePrize Developers Wiki

(Difference between revisions)
Jump to: navigation, search
Current revision (19:40, 14 May 2009) (edit) (undo)
 
(5 intermediate revisions not shown.)
Line 1: Line 1:
 +
{{future}}
 +
__NOTOC__
-
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.
+
This client library delivers basic instant-win and sweeps functionality. It is suitable to be used in an untrusted all-Flash promotion running completely on a consumer's computer.
 +
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) ==
Line 17: Line 20:
== promo.register() ==
== promo.register() ==
-
Register a new profile. If this succeeds, the effect is the same as calling login().
+
Register a new profile. If this succeeds, the effect is the same as calling login(). The primary key to identify the profile is email. If another profile already exists with the given email value, registration will fail. Registration is also subject to validation by ePrize PromotionSAFE technology and other registration validation tests.
== promo.playGame() ==
== promo.playGame() ==

Current revision

Warning - This version has not been released yet. This feature may be modified or removed before final release.


This client library delivers basic instant-win and sweeps functionality. It is suitable to be used in an untrusted all-Flash promotion running completely on a consumer's computer.

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)

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(). The primary key to identify the profile is email. If another profile already exists with the given email value, registration will fail. Registration is also subject to validation by ePrize PromotionSAFE technology and other registration validation tests.

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.

Personal tools