Groups | Blog | Home
all groups > flash actionscript > april 2006 >

flash actionscript : is it possible to disable a MC like a button?


w m d
4/2/2006 2:16:34 PM

Rothrock
4/2/2006 2:16:48 PM
That is strange. There is a MovieClip.enabled property listed in the help
files. And it worked for me in a simple test. (Okay the first time I typed
fasle instead of false and that didn't work, but once I worked out the error,
it worked fine.)
Wolf van Ween
4/2/2006 2:17:37 PM
Yes, this doesn't work for a movieClip. But it also shouldn't work for a button.
Because the property is not "enable".
It's "enabled". That works for buttons and movieClips.

But attention, have a look at the help file, because it only affects the
button-like behavior of a movieClip, not the timeline.
Wolf
(_seb_)
4/2/2006 3:50:24 PM
I have read that to disable a button, I should use the following code:

myButton.enable = false;

But this does not seem to work for a MC. How to do the same thing with ann MC?

--
seb ( ---@webtrans1.com)
http://webtrans1.com | high-end web design
David Stiller
4/2/2006 7:12:33 PM
(_seb_),

[quoted text, click to view]

I'm guessing you read this online somewhere, perhaps in this very forum?

[quoted text, click to view]

The other three (so far), w m d, Rothrock, and Wolf van Ween, have all
succinctly given the correct answer, so I can't add anything there. The
only thing to express is my surprise -- almost shock -- that your first step
wasn't simply to look in the ActionScript Language Reference. Buttons and
movie clips do share some features, but ultimately, each object is its own
datatype. In this case, both objects feature an enabled property, but one
should never make the assumption that a given object performs a certain way.

Objects are defined by their classes. The "Button class" entry of the
ActionScript Language Reference lists all the features of a button --
properties (characteristics), methods (things it can do), and events (things
it can react to). The "MovieClip class" lists all the features of a movie
clip. The TextField class lists all the features of a dynamic text field,
and so on. It's all conveniently laid out in neatly organized class
listings. :)


David
stiller (at) quip (dot) net
Dev essays: http://www.quip.net/blog/
"Luck is the residue of good design."

Wolf van Ween
4/3/2006 12:00:00 AM
David, my dream would be that the next version of Forum software would
automatically search for keywords and open the corresponding help file. Only
after you have looked at it for about 10 minutes and answered a few simple
questions will you be allowed to post :-)
Thanks for the support
Wolf
AddThis Social Bookmark Button