Packagecom.whirled.game
Classpublic class ServicesSubControl
InheritanceServicesSubControl Inheritance AbstractSubControl Inheritance AbstractControl Inheritance flash.events.EventDispatcher

Provides access to 'services' game services. Do not instantiate this class yourself, access it via GameControl.services.



Public Properties
 PropertyDefined by
  bags : BagsSubControl
[read-only] Access the 'bags' subcontrol.
ServicesSubControl
Public Methods
 MethodDefined by
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
AbstractControl
  
checkDictionaryWord(locale:String, dictionary:String, word:String, callback:Function):void
Checks to see if the dictionary for the given locale contains the given word.
ServicesSubControl
 Inherited
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server together.
AbstractSubControl
  
getDictionaryLetters(locale:String, dictionary:String, count:int, callback:Function):void
Requests a list of random letters from the dictionary service.
ServicesSubControl
  
getDictionaryWords(locale:String, dictionary:String, count:int, callback:Function):void
Requests a set of random words from the dictionary service.
ServicesSubControl
 Inherited
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just loaded up our SWF by itself?
AbstractSubControl
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
AbstractControl
  
startTicker(tickerName:String, msOfDelay:int):void
Start the ticker with the specified name.
ServicesSubControl
  
stopTicker(tickerName:String):void
Stop the specified ticker.
ServicesSubControl
Events
 EventSummaryDefined by
 Inherited Event.UNLOAD Dispatched when the SWF using this control has been unloaded.AbstractControl
Property detail
bagsproperty
bags:BagsSubControl  [read-only]

Access the 'bags' subcontrol.

Implementation
    public function get bags():BagsSubControl
Method detail
checkDictionaryWord()method
public function checkDictionaryWord(locale:String, dictionary:String, word:String, callback:Function):void

Checks to see if the dictionary for the given locale contains the given word.

Parameters
locale:String — RFC 3066 string that represents language settings, such as en-US.
 
dictionary:String — the dictionary to use, or null for the default. TODO: document possible parameters.
 
word:String — the string contains the word to be checked
 
callback:Function — the function that will process the results, of the form:
function (word :String, result :Boolean) :void
where word is a copy of the word that was requested, and result specifies whether the word is valid given language settings
getDictionaryLetters()method 
public function getDictionaryLetters(locale:String, dictionary:String, count:int, callback:Function):void

Requests a list of random letters from the dictionary service. The letters will arrive in a separate message with the specified key, as an array of strings. The returned letters aren't necessarily unique; there may be repeats in the array.

Parameters
locale:String — RFC 3066 string that represents language settings, such as en-US.
 
dictionary:String — the dictionary to use, or null for the default. TODO: document possible parameters.
 
count:int — the number of letters to be produced
 
callback:Function — the function that will process the results, of the form:
function (letters :Array) :void
where letters is an array of strings containing letters for the given language settings (potentially empty).
getDictionaryWords()method 
public function getDictionaryWords(locale:String, dictionary:String, count:int, callback:Function):void

Requests a set of random words from the dictionary service.

Parameters
locale:String — RFC 3066 string that represents language settings, such as en-US.
 
dictionary:String — the dictionary to use, or null for the default. TODO: document possible parameters.
 
count:int — the number of words to be produced, to a maximum of 100.
 
callback:Function — the function that will process the results, of the form:
function (words :Array) :void
where words is an array of strings. This array will not contain repeated elements. If an error occured, this array will be empty.
startTicker()method 
public function startTicker(tickerName:String, msOfDelay:int):void

Start the ticker with the specified name. The ticker will deliver messages (resulting in a MessageReceivedEvent being dispatched on the 'net' control) to all connected clients, at the specified delay. The value of each message is a single integer, starting with 0 and increasing by 1 with each messsage. Note: you may have a maximum of 3 tickers, and the minimum delay is 50ms. Note: When your game transitions to the GAME_ENDED state, all tickers are automatically stopped.

Parameters
tickerName:String
 
msOfDelay:int
stopTicker()method 
public function stopTicker(tickerName:String):void

Stop the specified ticker.

Parameters
tickerName:String