| Package | net.wonderfl.score.manager |
| Class | public class ScoreManager |
| Inheritance | ScoreManager flash.events.EventDispatcher |
| Property | Defined By | ||
|---|---|---|---|
| score : Array [read-only]
The score record fetched by the API. | ScoreManager | ||
| Method | Defined 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 | ||
| Method | Defined 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 | ||
| 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 | |||
| score | property |
score:Array [read-only]
The score record fetched by the API. You can access this value after
Event.COMPLETE is dispatched.
public function get score():Array| 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
| _onGetComplete | () | method |
protected function _onGetComplete($event:Event):voidThe callback for getting score api response.
Parameters
$event:Event |
See also
| _onSendComplete | () | method |
protected function _onSendComplete($event:Event):voidThe callback for sending score api response
Parameters
$event:Event |
See also
| getScore | () | method |
public function getScore($limit:int = 20, $descend:Boolean = true):voidThe 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):voidScore sending API
Parameters
$userName:String — Name for the record.
| |
$score:int — Score for the record.
|
| complete | Event |
flash.events.Eventflash.events.Event.COMPLETEDispatched when sending/fetching score record is completed successfully.
| error | Event |
flash.events.ErrorEventflash.events.ErrorEvent.ERRORDispatched when the api response contains an error message.
| ioError | Event |
flash.events.IOErrorEventflash.events.IOErrorEvent.IO_ERRORDispathced when io error occurred while sending/fetching score.