Packagenet.wonderfl.score.manager
Classpublic class ScoreManager
InheritanceScoreManager Inheritance flash.events.EventDispatcher

The score API for wonderfl



Public Properties
 PropertyDefined By
  score : Array
[read-only] The score record fetched by the API.
ScoreManager
Public Methods
 MethodDefined By
  
ScoreManager($displayObject:DisplayObject, $app_id:String, $api_key:String)
The 2nd and 3rd argument is needed only when you are accessing the api outside from wonderfl.net
ScoreManager
  
getScore($limit:int = 20, $descend:Boolean = true):void
The score getting api.
ScoreManager
  
sendScore($userName:String, $score:int):void
Score sending API
ScoreManager
Protected Methods
 MethodDefined By
  
_onGetComplete($event:Event):void
The callback for getting score api response.
ScoreManager
  
_onSendComplete($event:Event):void
The callback for sending score api response
ScoreManager
Events
 Event Summary Defined By
  Dispatched when sending/fetching score record is completed successfully.ScoreManager
  Dispatched when the api response contains an error message.ScoreManager
  Dispathced when io error occurred while sending/fetching score.ScoreManager
Property Detail
scoreproperty
score:Array  [read-only]

The score record fetched by the API. You can access this value after Event.COMPLETE is dispatched.


Implementation
    public function get score():Array
Constructor Detail
ScoreManager()Constructor
public function ScoreManager($displayObject:DisplayObject, $app_id:String, $api_key:String)

The 2nd and 3rd argument is needed only when you are accessing the api outside from wonderfl.net

Parameters
$displayObject:DisplayObject — Any display object which is listed under display tree.
 
$app_id:String — If you want to access the api outside from wonderfl.net, set this parameter.
 
$api_key:String — If you want to access the api outside from wonderfl.net, set this parameter.

See also

Method Detail
_onGetComplete()method
protected function _onGetComplete($event:Event):void

The callback for getting score api response.

Parameters

$event:Event

See also

_onSendComplete()method 
protected function _onSendComplete($event:Event):void

The callback for sending score api response

Parameters

$event:Event

See also

getScore()method 
public function getScore($limit:int = 20, $descend:Boolean = true):void

The score getting api.

Parameters

$limit:int (default = 20) — The max count of the score records.
 
$descend:Boolean (default = true) — If this flag is set true, the record is sorted by descending order, otherwise, the record is sorted by ascending order.

sendScore()method 
public function sendScore($userName:String, $score:int):void

Score sending API

Parameters

$userName:String — Name for the record.
 
$score:int — Score for the record.

Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

Dispatched when sending/fetching score record is completed successfully.

error Event  
Event Object Type: flash.events.ErrorEvent
ErrorEvent.type property = flash.events.ErrorEvent.ERROR

Dispatched when the api response contains an error message.

ioError Event  
Event Object Type: flash.events.IOErrorEvent
IOErrorEvent.type property = flash.events.IOErrorEvent.IO_ERROR

Dispathced when io error occurred while sending/fetching score.