View comments | RSS feed

MovieClip.enabled

Availability

Flash Player 6.

Usage

my_mc.enabled:Boolean

Description

Property; a Boolean value that indicates whether a movie clip is enabled. The default value of enabled is true. If enabled is set to false, the movie clip's callback methods and on action event handlers are no longer invoked, and the Over, Down, and Up frames are disabled. The enabled property does not affect the Timeline of the movie clip; if a movie clip is playing, it continues to play. The movie clip continues to receive movie clip events (for example, mouseDown, mouseUp, keyDown, and keyUp).

The enabled property only governs the button-like properties of a movie clip. You can change the enabled property at any time; the modified movie clip is immediately enabled or disabled. The enabled property can be read out of a prototype object. If enabled is set to false, the object is not included in automatic tab ordering.

Example

The following example disables the circle_mc movie clip when the user clicks it.

circle_mc.onRelease = function() {
   trace("disabling the "+this._name+" movie clip.");
   this.enabled = false;
};

Comments


Sardok said on Aug 12, 2005 at 3:11 AM :
Setting "MovieClip.enabled = false" also disables "onRollOver", "onRollOut", "onPress", "onRelease" and "onReleaseOutside".

This is in my opinion not properly documented because "onMouseDown" and "onMouseUp" still works when the movieclip has been disabled.

Test it with this script (you'll need a MovieClip named my_mc on the stage):
my_mc.enabled = false;
function myTrace () {trace("Testing");}
my_mc.onRollOver = function () {
trace("Please don't do that!!");}
my_mc.onRollOut = function () {
trace("Thanks!");}
my_mc.onPress = myTrace;
my_mc.onRelease = myTrace;
my_mc.onReleaseOutside = myTrace;
my_mc.onMouseDown = myTrace;
my_mc.onMouseMove = myTrace;
my_mc.onMouseUp = myTrace;
my_mc.onDragOver = myTrace;
my_mc.onDragOut = myTrace;
Arif Khan said on Sep 3, 2005 at 4:03 AM :
Yes this code is not working...
I have a movieclip which have so many objects on it, like buttons, combo boxes and list boxes... now i m doing the movieclip.enabled = false;

and its not been disabled properly :(
juanjo75 said on Oct 4, 2005 at 7:04 AM :
If you think that embedded clips' button actions will be disabled at the same time the parent clip's enabled property is equal to false, you are wrong.

The embedded clips button actions are still working..

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001497.html