DispatchableMovieClip
Kind of class: | class |
---|---|
Inherits from: | CoreMovieClip < MovieClip |
Implements: | |
Known subclasses: | |
Version: | 05/13/07 |
Author: | Aaron Clinger |
Classpath: | org.casalib.movieclip.DispatchableMovieClip |
File last modified: | Monday, 01 December 2008, 13:34:40 |
Base MovieClip that includes org.casalib.event.EventDispatcher and extends CoreMovieClip.
Summary
Class methods
- create (target:MovieClip, instanceName:String, depth:Number, initObject:Object) : DispatchableMovieClip
- Creates an empty instance of the DispatchableMovieClip class.
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.Instance methods inherited from CoreMovieClip
- destroy : Void
Class methods
create
static function create (target:MovieClip, instanceName:String, depth:Number, initObject:Object) : DispatchableMovieClipCreates an empty instance of the DispatchableMovieClip class. Use this instead of a traditionalnew
constructor statement due to limitations of ActionScript 2.0.Parameters:target :Location where the MovieClip should be attached.instanceName:A unique instance name for the MovieClip.depth :[optional] The depth level where the MovieClip is placed; defaults to next highest open depth.initObject :[optional] An object that contains properties with which to populate the newly attached MovieClip.Returns:- Returns a reference to the created instance.
Example:-
var myDispatch_mc:DispatchableMovieClip = DispatchableMovieClip.create(this, "example_mc");
Usage note:- If you want to extend a non empty MovieClip you can either define the ActionScript 2.0 class in the Flash IDE library or use org.casalib.util.MovieClipUtil.attachMovieRegisterClass.
Since:- Flash Player 7
Instance methods
addEventObserver
function addEventObserver (scope:Object, eventName:String, eventHandler:String) : BooleanRegisters a function to receive notification when a event handler is invoked.#Returns:- Returns {VISDOC_CODE_BLOCK_4} if the observer was established successfully; otherwise {VISDOC_CODE_BLOCK_5}.#
Specified by:destroy
function destroy () : VoidRemoves any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.#
Always callnew
before deleting last object pointer.Overrides:Specified by:dispatchEvent
function dispatchEvent (eventName:String) : BooleanReports event to all subscribed objects.#Returns:- Returns#
new
if observer(s) listening to specifed event were found; otherwisevar myDispatch_mc:DispatchableMovieClip = DispatchableMovieClip.create(this, "example_mc");
.
Specified by:removeAllEventObservers
function removeAllEventObservers () : BooleanRemoves 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) : BooleanRemoves specific observer for event.#Returns:- Returns {VISDOC_CODE_BLOCK_8} if the observer was successfully found and removed; otherwise {VISDOC_CODE_BLOCK_9}.#
removeEventObserversForEvent
function removeEventObserversForEvent (eventName:String) : BooleanRemoves all observers for a specified event.#removeEventObserversForScope
function removeEventObserversForScope (scope:Object) : BooleanRemoves all observers in a specified scope.# - dispatchEvent (eventName:String) : Boolean
- removeAllEventObservers : Boolean
- removeEventObserversForScope (scope:Object) : Boolean
- removeEventObserversForEvent (eventName:String) : Boolean
- removeEventObserver (scope:Object, eventName:String, eventHandler:String) : Boolean