LockingMovieClip

Kind of class:class
Inherits from:StatedMovieClip < CoreMovieClip < MovieClip
Implements:
Version:04/09/07
Author:Toby Boudreaux, Aaron Clinger
Classpath:org.casaframework.movieclip.LockingMovieClip
File last modified:Monday, 09 April 2007, 16:52:53
Extends StatedMovieClip and creates a locking interface for MovieClips.

This is different then using the enabled property because it completly removes all MovieClip event handlers and properties specified; does not only disable button events.
Example:
import org.casaframework.util.MovieClipUtil;

MovieClipUtil.attachMovieRegisterClass(org.casaframework.movieclip.LockingMovieClip, this, "linkageMovieClip", "locking_mc");

this.locking_mc.onRelease = function():Void {
    trace("I am unlocked.");
}

this.locking_mc.lock();

or is you only want to lock certain event handlers:
import org.casaframework.util.MovieClipUtil;

MovieClipUtil.attachMovieRegisterClass(org.casaframework.movieclip.LockingMovieClip, this, "linkageMovieClip", "locking_mc");

this.locking_mc.onRelease = function():Void {
    trace("I am unlocked.");
}

this.locking_mc.onRollOver = function():Void {
    this.gotoAndStop("rollOver");
}

this.locking_mc.onRollOut = this.locking_mc.onReleaseOutside = function():Void {
    this.gotoAndStop("rollOut");
}

this.locking_mc.lock(new Array("onRelease"));

Summary

Instance properties
Instance properties inherited from StatedMovieClip
Instance properties inherited from CoreMovieClip
Class methods
Class methods inherited from StatedMovieClip
Class methods inherited from CoreMovieClip

Class methods

create

static function create (
target:MovieClip, instanceName:String, depth:Number, initObject:Object) : LockingMovieClip
Creates an empty instance of the LockingMovieClip 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 myLocking_mc:LockingMovieClip = LockingMovieClip.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.casaframework.util.MovieClipUtil.attachMovieRegisterClass.

Instance methods

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 destroy() before deleting last object pointer.
#

isLocked

function isLocked (
) : Boolean
Returns:
Returns true if currently locked; otherwise false.
#

lock

function lock (
inclusionList:Array) : Void
Stores and removes event handlers to prevent them from triggering.
#
Parameters:
inclusionList:
[optional] List of event handlers and properties to lock. Defaults to all MovieClip event handlers.
#

toggle

function toggle (
) : Void
Switches the current state to the opposite state; between lock and unlock.
#

unlock

function unlock (
) : Void
Restores "locked" event handlers.
#