CasaSimpleButton
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.display |
| Inherits from: | SimpleButton |
| Implements: | |
| Version: | 02/11/10 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.display.CasaSimpleButton |
| File last modified: | Sunday, 28 March 2010, 11:55:55 |
A base SimpleButton that implements IRemovableEventDispatcher and IDestroyable.
Summary
Constructor
- CasaSimpleButton (upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null)
- Creates a new CasaSimpleButton.
Instance properties
Instance methods
- removeEventsForType (type:String) : void
- Removes all events of a specific type.
- removeEventsForListener (listener:Function) : void
- Removes all events that report to the specified listener.
- removeEventListeners : void
- Removes all event listeners.
- getTotalEventListeners (type:String = null) : uint
- Reports the number of listeners for a specific event or the total listeners for all events.
- removeChildren (destroyChildren:Boolean = false, recursive:Boolean = false) : void
- Removes and optionally destroys the button states of the CasaSprite.
- removeChildrenAndDestroy (destroyChildren:Boolean = false, recursive:Boolean = false) : void
- Removes and optionally destroys the button states of the CasaSprite then destroys itself.
- destroy : void
- Removes any event listeners and stops all internal processes to help allow for prompt garbage collection.
- removeChildren (destroyChildren:Boolean = false, recursive:Boolean = false) : void
Constructor
CasaSimpleButton
public function CasaSimpleButton (upState:DisplayObject = null, overState:DisplayObject = null, downState:DisplayObject = null, hitTestState:DisplayObject = null)Creates a new CasaSimpleButton.Parameters:upState :The initial value for the SimpleButton up state.overState :The initial value for the SimpleButton over state.downState :The initial value for the SimpleButton down state.hitTestState:The initial value for the SimpleButton hitTest state.Instance properties
destroyed
public destroyed:Boolean(read)stage
override public stage:Stage(read)The Stage of the display object or if the display object is not added to the display list and StageReference is definedstagewill return the default stage; otherwisenull.Instance methods
destroy
public function destroy () : voidRemoves any event listeners and stops all internal processes to help allow for prompt garbage collection.#
Always callstagebefore deleting last object pointer.
Callingdestroy()on a CASA display object also removes it from its current parent.Specified by:getTotalEventListeners
public function getTotalEventListeners (type:String = null) : uintReports the number of listeners for a specific event or the total listeners for all events.#removeChildren
public function removeChildren (destroyChildren:Boolean = false, recursive:Boolean = false) : voidRemoves and optionally destroys the button states of the CasaSprite.Parameters:destroyChildren:If the button state implements IDestroyable call its destroy methodtrue, or don't destroyfalse; defaults tofalse.recursive :Call this method with the same arguments on all of the button state's children (all the way down the display list)true, or leave the button state's childrenfalse; defaults tofalse.removeChildrenAndDestroy
public function removeChildrenAndDestroy (destroyChildren:Boolean = false, recursive:Boolean = false) : voidRemoves and optionally destroys the button states of the CasaSprite then destroys itself.Parameters:destroyChildren:If the button state implements IDestroyable call its destroy methodtrue, or don't destroyfalse; defaults tofalse.recursive :Call this method with the same arguments on all of the button state's children (all the way down the display list)true, or leave the button state's childrenfalse; defaults tofalse.removeEventListeners
public function removeEventListeners () : voidRemoves all event listeners.#Specified by:removeEventsForListener
public function removeEventsForListener (listener:Function) : voidRemoves all events that report to the specified listener.#Parameters:listener:The listener function that processes the event.#Specified by: - getTotalEventListeners (type:String = null) : uint
- removeEventListeners : void
- removeEventsForListener (listener:Function) : void