Packagemochi.as3
Classpublic class MochiServices
InheritanceMochiServices Inheritance Object



Public Properties
 PropertyDefined By
  childClip : Object
[static] [read-only]
MochiServices
  clip : Object
[static] [read-only]
MochiServices
  comChannelName : String
[static] [write-only]
MochiServices
  connected : Boolean
[static] [read-only]
MochiServices
  id : String
[static] [read-only]
MochiServices
  netup : Boolean = true
[static]
MochiServices
  netupAttempted : Boolean = false
[static]
MochiServices
  onError : Object
[static]
MochiServices
  widget : Boolean = false
[static]
MochiServices
Public Methods
 MethodDefined By
  
addEventListener(eventType:String, delegate:Function):void
[static]
MochiServices
  
addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function = null):void
[static]
MochiServices
  
allowDomains(server:String):String
[static]
MochiServices
  
bringToTop(e:Event = null):void
[static]
MochiServices
  
connect(id:String, clip:Object, onError:Object = null):void
[static] Method: connect Connects your game to the MochiServices API
MochiServices
  
connectWait(e:TimerEvent):void
[static]
MochiServices
  
disconnect():void
[static]
MochiServices
  
doClose():void
[static]
MochiServices
  
getVersion():String
[static]
MochiServices
  
[static]
MochiServices
  
removeEventListener(eventType:String, delegate:Function):void
[static]
MochiServices
  
send(methodName:String, args:Object = null, callbackObject:Object = null, callbackMethod:Object = null):void
[static]
MochiServices
  
setContainer(container:Object = null, doAdd:Boolean = true):void
[static]
MochiServices
  
stayOnTop():void
[static]
MochiServices
  
triggerEvent(eventType:String, args:Object):void
[static]
MochiServices
  
warnID(bid:String, leaderboard:Boolean):void
[static]
MochiServices
Public Constants
 ConstantDefined By
  CONNECTED : String = onConnected
[static]
MochiServices
Property Detail
childClipproperty
childClip:Object  [read-only]


Implementation
    public static function get childClip():Object
clipproperty 
clip:Object  [read-only]


Implementation
    public static function get clip():Object
comChannelNameproperty 
comChannelName:String  [write-only]


Implementation
    public static function set comChannelName(value:String):void
connectedproperty 
connected:Boolean  [read-only]


Implementation
    public static function get connected():Boolean
idproperty 
id:String  [read-only]


Implementation
    public static function get id():String
netupproperty 
public static var netup:Boolean = true

netupAttemptedproperty 
public static var netupAttempted:Boolean = false

onErrorproperty 
public static var onError:Object

widgetproperty 
public static var widget:Boolean = false

Method Detail
addEventListener()method
public static function addEventListener(eventType:String, delegate:Function):void

Parameters

eventType:String
 
delegate:Function

addLinkEvent()method 
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function = null):void

Parameters

url:String
 
burl:String
 
btn:DisplayObjectContainer
 
onClick:Function (default = null)

allowDomains()method 
public static function allowDomains(server:String):String

Parameters

server:String

Returns
String
bringToTop()method 
public static function bringToTop(e:Event = null):void

Parameters

e:Event (default = null)

connect()method 
public static function connect(id:String, clip:Object, onError:Object = null):void

Method: connect Connects your game to the MochiServices API

Parameters

id:String — the MochiAds ID of your game
 
clip:Object — the MovieClip in which to load the API (optional for all but AS3, defaults to _root)
 
onError:Object (default = null) — a function to call upon connection or IO error

connectWait()method 
public static function connectWait(e:TimerEvent):void

Parameters

e:TimerEvent

disconnect()method 
public static function disconnect():void

doClose()method 
public static function doClose():void

getVersion()method 
public static function getVersion():String

Returns
String
isNetworkAvailable()method 
public static function isNetworkAvailable():Boolean

Returns
Boolean
removeEventListener()method 
public static function removeEventListener(eventType:String, delegate:Function):void

Parameters

eventType:String
 
delegate:Function

send()method 
public static function send(methodName:String, args:Object = null, callbackObject:Object = null, callbackMethod:Object = null):void

Parameters

methodName:String
 
args:Object (default = null)
 
callbackObject:Object (default = null)
 
callbackMethod:Object (default = null)

setContainer()method 
public static function setContainer(container:Object = null, doAdd:Boolean = true):void

Parameters

container:Object (default = null)
 
doAdd:Boolean (default = true)

stayOnTop()method 
public static function stayOnTop():void

triggerEvent()method 
public static function triggerEvent(eventType:String, args:Object):void

Parameters

eventType:String
 
args:Object

warnID()method 
public static function warnID(bid:String, leaderboard:Boolean):void

Parameters

bid:String
 
leaderboard:Boolean

Constant Detail
CONNECTEDConstant
public static const CONNECTED:String = onConnected