EventMovieClip

Kind of class:class
Inherits from:DispatchableMovieClip < CoreMovieClip < MovieClip
Version:05/13/07
Author:Aaron Clinger
Classpath:org.casalib.movieclip.EventMovieClip
File last modified:Monday, 01 December 2008, 13:34:40
Dispatches MovieClip event handler notification using org.casalib.event.EventDispatcher.
Example:
  • import org.casalib.movieclip.EventMovieClip;
    import org.casalib.util.MovieClipUtil;
    
    function movieClipLoad(sender_mc:MovieClip):Void {
        trace(sender_mc + " has loaded.");
    }
    
    function movieClipPress(sender_mc:MovieClip):Void {
        trace(sender_mc + " was pressed.");
    }
    
    MovieClipUtil.attachMovieRegisterClass(org.casalib.movieclip.EventMovieClip, this, "linkageMovieClip", "event_mc");
    
    this.event_mc.addEventObserver(this, EventMovieClip.EVENT_LOAD, "movieClipLoad");
    this.event_mc.addEventObserver(this, EventMovieClip.EVENT_PRESS, "movieClipPress");
Events broadcasted to listeners:
  • onData = function (sender_mc:MovieClip) {}
  • onDragOut = function (sender_mc:MovieClip) {}
  • onDragOver = function (sender_mc:MovieClip) {}
  • onEnterFrame = function (sender_mc:MovieClip) {}
  • onKeyDown = function (sender_mc:MovieClip) {}
  • onKeyUp = function (sender_mc:MovieClip) {}
  • onKillFocus = function (sender_mc:MovieClip, newFocus:Object) {}
  • onLoad = function (sender_mc:MovieClip) {}
  • onMouseDown = function (sender_mc:MovieClip) {}
  • onMouseMove = function (sender_mc:MovieClip) {}
  • onMouseUp = function (sender_mc:MovieClip) {}
  • onPress = function (sender_mc:MovieClip) {}
  • onRelease = function (sender_mc:MovieClip) {}
  • onReleaseOutside = function (sender_mc:MovieClip) {}
  • onRollOut = function (sender_mc:MovieClip) {}
  • onRollOver = function (sender_mc:MovieClip) {}
  • onSetFocus = function (sender_mc:MovieClip, oldFocus:Object) {}
  • onUnload = function (sender_mc:MovieClip) {}

Summary


Class properties
Class methods
  • create (target:MovieClip, instanceName:String, depth:Number, initObject:Object) : EventMovieClip
    • Creates an empty instance of the EventMovieClip class.
Class methods inherited from DispatchableMovieClip
Class methods inherited from CoreMovieClip

Class properties

EVENT_DATA

static EVENT_DATA:String = 'onData'
(read,write)

EVENT_DRAG_OUT

static EVENT_DRAG_OUT:String = 'onDragOut'
(read,write)

EVENT_DRAG_OVER

static EVENT_DRAG_OVER:String = 'onDragOver'
(read,write)

EVENT_ENTER_FRAME

static EVENT_ENTER_FRAME:String = 'onEnterFrame'
(read,write)

EVENT_KEY_DOWN

static EVENT_KEY_DOWN:String = 'onKeyDown'
(read,write)

EVENT_KEY_UP

static EVENT_KEY_UP:String = 'onKeyUp'
(read,write)

EVENT_KILL_FOCUS

static EVENT_KILL_FOCUS:String = 'onKillFocus'
(read,write)

EVENT_LOAD

static EVENT_LOAD:String = 'onLoad'
(read,write)

EVENT_MOUSE_DOWN

static EVENT_MOUSE_DOWN:String = 'onMouseDown'
(read,write)

EVENT_MOUSE_MOVE

static EVENT_MOUSE_MOVE:String = 'onMouseMove'
(read,write)

EVENT_MOUSE_UP

static EVENT_MOUSE_UP:String = 'onMouseUp'
(read,write)

EVENT_PRESS

static EVENT_PRESS:String = 'onPress'
(read,write)

EVENT_RELEASE

static EVENT_RELEASE:String = 'onRelease'
(read,write)

EVENT_RELEASE_OUTSIDE

static EVENT_RELEASE_OUTSIDE:String = 'onReleaseOutside'
(read,write)

EVENT_ROLL_OUT

static EVENT_ROLL_OUT:String = 'onRollOut'
(read,write)

EVENT_ROLL_OVER

static EVENT_ROLL_OVER:String = 'onRollOver'
(read,write)

EVENT_SET_FOCUS

static EVENT_SET_FOCUS:String = 'onSetFocus'
(read,write)

EVENT_UNLOAD

static EVENT_UNLOAD:String = 'onUnload'
(read,write)

Class methods

create

static function create (
target:MovieClip, instanceName:String, depth:Number, initObject:Object) : EventMovieClip

Creates an empty instance of the EventMovieClip class. Use this instead of a traditional new 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 myEvent_mc:EventMovieClip = EventMovieClip.create(this, "example_mc");
Usage note:
Since:
  • Flash Player 7