Flash Playground.publishActivityFeed
From J2Play
Contents |
Description
Publish a feed for your activity.
There are some templates you can used in your feed without setting the data.
{actor} : Your name
{gameurl} : The url of game
{gamename} : The title of the game
{gamelink} : <a href={gameurl}>game name</a>
{description}: Game description
{hisher} : the possessive pronoun associated with the actor
{heshe} : the pronoun associated with the actor
{himher} : the objective pronoun associated with the actor
{himselfherself} : the reflexive pronoun associated with the actor
Never use {images}, {flash}, {mp3}, or {video} in you templates
Syntax
static function publishActivityFeed(titleTemplate : String, titleData : String, summaryTemplate: String, summaryData : String) : Void;
Parameters
* @param titleTemplate the feed title template (Cannot exceed 60 characters)
* @param titleData the feed title parameters, it is a string which represents a data hashmap as "key|value|key|value|..."
* @param summaryTemplate the the feed summary template (Cannot exceed 200 characters)
** {body}: always set this parameter to {body}
* @param summaryData the feed summary parameters, it is a string which represents a data hashmap as "key|value|key|value|..."
Return Value
N/A
Examples
For example, one line feed for that the player got the score in a game
//Make sure the import code is inserted at the top of the frame
import ca.j2x.flash.Playground;
Playground.publishActivityFeed(
"{actor} got score:{score} in {gamelink}.",
"score|" + gameScoreVar,
"{body}",
"body|This is a fantastic game try it for yourself and get a better score. try {gamelink} now!");
And, the feed with summary for a player got rank and score in a game
//Make sure the import code is inserted at the top of the frame
import ca.j2x.flash.Playground;
Playground.publishActivityFeed(
"{actor} played the {gamelink}",
"",
"{actor} completed rank:{rank} and got score:{score} in {gamelink}",
"rank|"+rankVar+"|score|"+gameScoreVar);
