Groups | Blog | Home
all groups > flash actionscript > may 2005 >

flash actionscript : How to disable all instances of a particular button


kglad
5/12/2005 12:00:00 AM
karma-lab
5/12/2005 12:00:00 AM
They don't have instance names, but the library object is named "mainButton"
for example.

I've been looking at examples for looping through objects (which I just
found), but I haven't figured out how to differentiate these particular objects
from others. I need to do it for all instances of mainButton inside a
particular movieclip (but not the whole timeline).
kglad
5/12/2005 12:00:00 AM
are there any other buttons in that movieclip? are there any textfields and
any objects (defined by something=new Object() ) in that movieclip. if the
answer is no, we're in business. if the answer is yes, but there are a
managably small number of other buttons, textfields and objects, we're still in
business.
karma-lab
5/12/2005 6:59:59 PM
I'm sure this is easy, just haven't found how to do it.

Say you have 4000 instances of a particular button used in a movie, and you
want to disable all of them from being clicked based on some other button. How
can you do this?
karma-lab
5/13/2005 12:00:00 AM
Thanks anyway - I found another reply of yours somewhere else about looping
through objects and testing for what they are, using typeof and instanceof, and
I was able to accomplish what I needed.

Also, a really stupid way of blocking every button is to just put a
movie-sized button that does nothing over the whole thing, and make it _visible
or not. You can even tell the button myButton .useHandCursor = false, in which
case it doesn't respond to mouseovers, but just blocks every button that's
underneath it.
kglad
5/13/2005 12:00:00 AM
AddThis Social Bookmark Button