| Package | yourminis.api.social |
| Class | public class SimpleSocial |
| Inheritance | SimpleSocial flash.events.EventDispatcher |
| Implements | ISocial |
See also
| Property | Defined by | ||
|---|---|---|---|
| ACTIVITY_CREATED : String [read-only] Event fired when an activity has been created
| SimpleSocial | ||
| AUTHENTICATION_COMPLETE : String [read-only] Event fired when authentication is completed
| SimpleSocial | ||
| Friends : Array [read-only]
Provide read-only access to Friends data
| SimpleSocial | ||
| socialDelegate : ISocial
[read-only]
Provide direct access to the underlying Social API implementation.
| SimpleSocial | ||
| SOCIAL_ONGETFRIENDS : String [read-only] Event fired when social friends have been retrieved
| SimpleSocial | ||
| socialType : String [read-only]
Provide read-only access to the Social Type of the Social API
| SimpleSocial | ||
| socialVariant : String [read-only]
Provide read-only access to the Social Type Variant of the Social API.
| SimpleSocial | ||
| Method | Defined by | ||
|---|---|---|---|
|
SimpleSocial(_widget:Widget)
| SimpleSocial | ||
|
createActivity(title:String, body:String, summary:String = null, url:String = null, media:Array = null):void
Publishes a new Activity for the current user within the social environment (if one exists).
| SimpleSocial | ||
|
getCurrentView():String
Returns the current view.
| SimpleSocial | ||
|
getFriends():void
Gets friends for current user within the social environment (if one exists).
| SimpleSocial | ||
|
getParameter(parameter_name:String):String
Returns the value of the specified parameter if it has been passed in by the social application, an empty string if not.
| SimpleSocial | ||
|
isBebo():Boolean
Determine if we are running inside bebo
| SimpleSocial | ||
|
isFacebook():Boolean
Determine if we are running inside facebook
| SimpleSocial | ||
|
isOpensocial():Boolean
Determine if we are running inside an opensocial container
| SimpleSocial | ||
|
isSocial():Boolean
Determine if we are running inside a social network
| SimpleSocial | ||
| Constant | Defined by | ||
|---|---|---|---|
| SOCIAL_TYPE_BEBO : String = "bebo" [static] social api bebo
| SimpleSocial | ||
| SOCIAL_TYPE_FACEBOOK : String = "facebook" [static] social api facebook
| SimpleSocial | ||
| SOCIAL_TYPE_NONE : String = "none" [static] social api none
| SimpleSocial | ||
| SOCIAL_TYPE_OPENSOCIAL : String = "opensocial" [static] social api opensocial
| SimpleSocial | ||
| ACTIVITY_CREATED | property |
ACTIVITY_CREATED:String [read-only]Event fired when an activity has been created
Implementation public function get ACTIVITY_CREATED():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
widget.social.addEventListener(widget.social.ACTIVITY_CREATED, onActivityCreated);
widget.social.createActivity("clicked a link", "The full URL is: http://www.yourminis.com");
}
function onActivityCreated(evt:Event):void {
widget.debug("activity created");
}
| AUTHENTICATION_COMPLETE | property |
AUTHENTICATION_COMPLETE:String [read-only]Event fired when authentication is completed
Implementation public function get AUTHENTICATION_COMPLETE():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);//We must use a string literal instead of a constant because the event constants are not yet initialized in the widget class
function onWidgetLoaded(evt:Event):void {
widget.initWidget(300,250,0x000000);
widget.requireLibrary("facebook", ");
widget.addEventListener(widget.LIBRARIES_LOADED, onLibrariesLoaded);
}
function onLibrariesLoaded(evt:Event):void{
widget.initWidget();
widget.libraries.facebook.api_key = "5efb77b97275f66bde1ba5347f1116c2";
widget.libraries.facebook.secret = "ba566af38313fbb961034ab477b90c92";
widget.libraries.facebook.addEventListener(widget.social.AUTHENTICATION_COMPLETE, onAuthenticated);
widget.libraries.facebook.dispatchEvent(new Event(widget.social.NEED_AUTHENTICATION));
}
function onAuthenticated(evt:Event):void
{
widget.alert("authenticated!");
}
| Friends | property |
Friends:Array [read-only]Provide read-only access to Friends data
Implementation public function get Friends():Array
| socialDelegate | property |
socialDelegate:ISocial [read-only]Provide direct access to the underlying Social API implementation. This is useful in cases where you wish to call APIs specific to the underlying service.
Implementation public function get socialDelegate():ISocial
| SOCIAL_ONGETFRIENDS | property |
SOCIAL_ONGETFRIENDS:String [read-only]Event fired when social friends have been retrieved
Implementation public function get SOCIAL_ONGETFRIENDS():String
import yourminis.api.IWidget
var widget:IWidget;
addEventListener("widget-loaded",onWidgetLoaded);
function onWidgetLoaded(evt:Event):void {
widget.debugMode = true;
widget.initWidget(300,250,0x000000);
widget.social.addEventListener(widget.social.SOCIAL_ONGETFRIENDS, onGetFriends);
widget.social.getFriends();
}
function onGetFriends(evt:Event):void {
widget.debug(widget.social.Friends[0]);
}
| socialType | property |
socialType:String [read-only]Provide read-only access to the Social Type of the Social API
Implementation public function get socialType():String
| socialVariant | property |
socialVariant:String [read-only]Provide read-only access to the Social Type Variant of the Social API. For opensocial, this corresponds to the container (orkut, ning, myspace, etc...)
Implementation public function get socialVariant():String
| SimpleSocial | () | constructor |
| createActivity | () | method |
public function createActivity(title:String, body:String, summary:String = null, url:String = null, media:Array = null):voidPublishes a new Activity for the current user within the social environment (if one exists). Fires an ACTIVITY_CREATED event upon response.
Parameterstitle:String |
|
body:String |
|
summary:String (default = null) |
|
url:String (default = null) |
|
media:Array (default = null) |
See also
| getCurrentView | () | method |
public function getCurrentView():StringReturns the current view. On Myspace, for example, this would be 'home','canvas', or 'profile'
ReturnsString |
See also
| getFriends | () | method |
public function getFriends():voidGets friends for current user within the social environment (if one exists). Fires an SOCIAL_ONGETFRIENDS event upon response.
See also
| getParameter | () | method |
public function getParameter(parameter_name:String):StringReturns the value of the specified parameter if it has been passed in by the social application, an empty string if not.
Parametersparameter_name:String — The name of the social parameter to get the value for (e.g. 'fb_sig_locale').
|
String |
| isBebo | () | method |
public function isBebo():BooleanDetermine if we are running inside bebo
ReturnsBoolean |
| isFacebook | () | method |
public function isFacebook():BooleanDetermine if we are running inside facebook
ReturnsBoolean |
| isOpensocial | () | method |
public function isOpensocial():BooleanDetermine if we are running inside an opensocial container
ReturnsBoolean |
| isSocial | () | method |
public function isSocial():BooleanDetermine if we are running inside a social network
ReturnsBoolean |
| SOCIAL_TYPE_BEBO | constant |
public static const SOCIAL_TYPE_BEBO:String = "bebo"social api bebo
| SOCIAL_TYPE_FACEBOOK | constant |
public static const SOCIAL_TYPE_FACEBOOK:String = "facebook"social api facebook
| SOCIAL_TYPE_NONE | constant |
public static const SOCIAL_TYPE_NONE:String = "none"social api none
| SOCIAL_TYPE_OPENSOCIAL | constant |
public static const SOCIAL_TYPE_OPENSOCIAL:String = "opensocial"social api opensocial