Packagefeathers.core
Classpublic class TokenList
InheritanceTokenList Inheritance EventDispatcher Inheritance Object

Product Version : Feathers 1.0.0

A list of space-delimited tokens. Obviously, since they are delimited by spaces, tokens cannot contain spaces.



Public Properties
 PropertyDefined By
  length : int
[read-only] The number of tokens in the list.
TokenList
  value : String
The tokens formatted with space delimiters.
TokenList
Protected Properties
 PropertyDefined By
  _joinedNames : String = null
TokenList
Public Methods
 MethodDefined By
  
Constructor.
TokenList
  
add(name:String):void
Adds a token to the list.
TokenList
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
  
contains(name:String):Boolean
Determines if the specified token is in the list.
TokenList
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
  
item(index:int):String
Returns the token at the specified index, or null, if there is no token at that index.
TokenList
  
remove(name:String):void
Removes a token from the list, if the token is in the list.
TokenList
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
  
toggle(name:String):void
The token is added to the list if it doesn't appear in the list, or it is removed from the list if it is already in the list.
TokenList
Events
 Event Summary Defined By
  Dispatched when a token is added, removed, or toggled or if all tokens have been replaced by setting the value property.TokenList
Property Detail
_joinedNamesproperty
protected var _joinedNames:String = null

lengthproperty 
length:int  [read-only]

The number of tokens in the list.


Implementation
    public function get length():int
valueproperty 
value:String

The tokens formatted with space delimiters.

The default value is "".


Implementation
    public function get value():String
    public function set value(value:String):void
Constructor Detail
TokenList()Constructor
public function TokenList()

Constructor.

Method Detail
add()method
public function add(name:String):void

Adds a token to the list. If the token already appears in the list, it will not be added again.

Parameters

name:String

contains()method 
public function contains(name:String):Boolean

Determines if the specified token is in the list.

Parameters

name:String

Returns
Boolean
item()method 
public function item(index:int):String

Returns the token at the specified index, or null, if there is no token at that index.

Parameters

index:int

Returns
String
remove()method 
public function remove(name:String):void

Removes a token from the list, if the token is in the list. If the token doesn't appear in the list, this call does nothing.

Parameters

name:String

toggle()method 
public function toggle(name:String):void

The token is added to the list if it doesn't appear in the list, or it is removed from the list if it is already in the list.

Parameters

name:String

Event Detail
change Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.CHANGE

Dispatched when a token is added, removed, or toggled or if all tokens have been replaced by setting the value property.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
datanull
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

An event type to be utilized in custom events. Not used by Starling right now.