LockingMovieClip
Kind of class: | class |
---|---|
Inherits from: | StatedMovieClip < CoreMovieClip < MovieClip |
Implements: | |
Version: | 05/13/07 |
Author: | Toby Boudreaux, Aaron Clinger |
Classpath: | org.casalib.movieclip.LockingMovieClip |
File last modified: | Monday, 01 December 2008, 13:34:40 |
Extends StatedMovieClip and creates a locking interface for MovieClips.
This is different then using the
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.casalib.util.MovieClipUtil; MovieClipUtil.attachMovieRegisterClass(org.casalib.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.casalib.util.MovieClipUtil; MovieClipUtil.attachMovieRegisterClass(org.casalib.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
Class methods
- create (target:MovieClip, instanceName:String, depth:Number, initObject:Object) : LockingMovieClip
- Creates an empty instance of the LockingMovieClip class.
Class methods inherited from StatedMovieClip
Class methods inherited from CoreMovieClip
Instance methods
- lock (inclusionList:Array) : Void
- Stores and removes event handlers to prevent them from triggering.
- unlock : Void
- Restores "locked" event handlers.
- toggle : Void
- Switches the current state to the opposite state; between lock and unlock.
- isLocked : Boolean
- 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 StatedMovieClipInstance methods inherited from CoreMovieClip
Class methods
create
static function create (target:MovieClip, instanceName:String, depth:Number, initObject:Object) : LockingMovieClipCreates an empty instance of the LockingMovieClip 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 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.casalib.util.MovieClipUtil.attachMovieRegisterClass.
Since:- Flash Player 7
Instance methods
destroy
function destroy () : VoidRemoves any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.#
Always callenabled
before deleting last object pointer.Overrides:Specified by:isLocked
function isLocked () : BooleanReturns:- Returns#
enabled
if currently locked; otherwiseimport org.casalib.util.MovieClipUtil; MovieClipUtil.attachMovieRegisterClass(org.casalib.movieclip.LockingMovieClip, this, "linkageMovieClip", "locking_mc"); this.locking_mc.onRelease = function():Void { trace("I am unlocked."); } this.locking_mc.lock();
.
Specified by:lock
function lock (inclusionList:Array) : VoidStores 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.#Specified by:toggle
function toggle () : VoidSpecified by: - toggle : Void
- unlock : Void