DispatchableTextField

Kind of class:class
Inherits from:CoreTextField < CoreMovieClip < MovieClip
Implements:
Known subclasses:
Version:06/21/07
Author:Aaron Clinger
Classpath:org.casalib.textfield.DispatchableTextField
File last modified:Monday, 01 December 2008, 13:34:40
Base "TextField" that includes org.casalib.event.EventDispatcher and extends CoreTextField.
See also:

Summary


Class methods
  • create (target:MovieClip, instanceName:String, depth:Number, width:Number, height:Number) : DispatchableTextField
    • Creates an empty instance of the DispatchableTextField class.
Class methods inherited from CoreTextField
Class methods inherited from CoreMovieClip
Instance methods
  • addEventObserver (scope:Object, eventName:String, eventHandler:String) : Boolean
    • Registers a function to receive notification when a event handler is invoked.
  • removeEventObserver (scope:Object, eventName:String, eventHandler:String) : Boolean
    • Removes specific observer for event.
  • removeEventObserversForEvent (eventName:String) : Boolean
    • Removes all observers for a specified event.
  • removeEventObserversForScope (scope:Object) : Boolean
    • Removes all observers in a specified scope.
  • removeAllEventObservers : Boolean
    • Removes all observers regardless of scope or event.
  • dispatchEvent (eventName:String) : Boolean
    • Reports event to all subscribed objects.
  • destroy : Void
    • Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.
Event handlers

Class methods

create

static function create (
target:MovieClip, instanceName:String, depth:Number, width:Number, height:Number) : DispatchableTextField

Creates an empty instance of the DispatchableTextField class. Use this instead of a traditional new constructor statement due to limitations of ActionScript 2.0.
Parameters:
target :
Location where the TextField should be attached.
instanceName:
A unique instance name for the TextField.
depth :
[optional] The depth level where the TextField is placed; defaults to next highest open depth.
width :
A positive integer that specifies the width of the new text field.
height :
A positive integer that specifies the height of the new text field.
Returns:
  • Returns a reference to the created instance.
Example:
  • var myText_mc:DispatchableTextField = DispatchableTextField.create(this, "text_mc", null, 250, 50);
Since:
  • Flash Player 7

Instance methods

addEventObserver

function addEventObserver (
scope:Object, eventName:String, eventHandler:String) : Boolean

Registers a function to receive notification when a event handler is invoked.
#
Parameters:
scope :
The target or object in which to subscribe.
#
eventName :
Event name to subscribe to.
#
eventHandler:
[optional] Name of function to recieve the event. If undefined class assumes {VISDOC_CODE_BLOCK_2} matches {VISDOC_CODE_BLOCK_3}.
#
Returns:
  • Returns {VISDOC_CODE_BLOCK_4} if the observer was established successfully; otherwise {VISDOC_CODE_BLOCK_5}.
    #

destroy

function destroy (
) : Void

Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.

Always call new before deleting last object pointer.
#

dispatchEvent

function dispatchEvent (
eventName:String) : Boolean

Reports event to all subscribed objects.
#
Parameters:
eventName:
Event name.
#
param(s) :
[optional] Parameters passed to the function specified by "eventName". Multiple parameters are allowed and should be separated by commas: param1,param2, ...,paramN
#
Returns:
  • Returns new if observer(s) listening to specifed event were found; otherwise var myText_mc:DispatchableTextField = DispatchableTextField.create(this, "text_mc", null, 250, 50);.
    #

removeAllEventObservers

function removeAllEventObservers (
) : Boolean

Removes all observers regardless of scope or event.
#
Returns:
  • Returns {VISDOC_CODE_BLOCK_16} if observers were successfully removed; otherwise {VISDOC_CODE_BLOCK_17}.
    #

removeEventObserver

function removeEventObserver (
scope:Object, eventName:String, eventHandler:String) : Boolean

Removes specific observer for event.
#
Parameters:
scope :
The target or object in which subscribed.
#
eventName :
Event name to unsubscribe to.
#
eventHandler:
[optional] Name of function that recieved the event. If undefined class assumes {VISDOC_CODE_BLOCK_6} matched {VISDOC_CODE_BLOCK_7}.
#
Returns:
  • Returns {VISDOC_CODE_BLOCK_8} if the observer was successfully found and removed; otherwise {VISDOC_CODE_BLOCK_9}.
    #

removeEventObserversForEvent

function removeEventObserversForEvent (
eventName:String) : Boolean

Removes all observers for a specified event.
#
Parameters:
eventName:
Event name to unsubscribe to.
#
Returns:
  • Returns {VISDOC_CODE_BLOCK_10} if observers were successfully found for specified {VISDOC_CODE_BLOCK_11} and removed; otherwise {VISDOC_CODE_BLOCK_12}.
    #

removeEventObserversForScope

function removeEventObserversForScope (
scope:Object) : Boolean

Removes all observers in a specified scope.
#
Parameters:
scope:
The target or object in which to unsubscribe.
#
Returns:
  • Returns {VISDOC_CODE_BLOCK_13} if observers were successfully found in {VISDOC_CODE_BLOCK_14} and removed; otherwise {VISDOC_CODE_BLOCK_15}.
    #