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

flash actionscript : buttons underneath a MC still work!



(_seb_)
3/29/2005 10:12:28 PM
And they shouldn't, OF COURSE!
Why is it that way?

Why is a button completely covered by another MC, still active?
My MC has some mouse actions on it, and as long as it is in front of
another button, the other button is OBVIOUSLY not supposed to be active,
has anybody in their right mind would NATURALLY EXPECT!!!!
Yet, is the only solution to this, to add some code in order to
de-activate my buttons (12 of them, that would be 12 lines of code), or
am I missing something?

Thanks for your help, and your calming advice if possible

--
Byron Canfield
3/29/2005 11:20:25 PM
THAT'S IMPOSSIBLE! Oh, wait a minute...

:)

Been there, done that.

[quoted text, click to view]

(_seb_)
3/30/2005 12:28:53 AM
sorry for all the noise.

I thought that my buttons were still active even when placed behind an
MC that had mouse events actions applied to it. But they weren't,
something was wrong with my setup.
So everything is fine.


[quoted text, click to view]

--
rlc5611
3/30/2005 3:55:05 AM
A slightly less obvious solution is to make a rectangle the size of your clip
inside your movie clip in the very bottom layer of that clip (i.e. below
everything else). Make that rectangle a movie clip and give it an alpha of 0
(don't make it invisible). Give it an instance name and apply this:
myalphazerobackgroundclipname.onRollOver = function() { this.useHandCursor =
false; } This alpha 0 clip will act like a button so anything underneath it
won't be reachable but the finger pointer won't show up so it won't appear to
be a button.
David Stiller
3/30/2005 9:07:49 AM
[quoted text, click to view]

To my thinking, that would be the best approach. It wouldn't take 12
lines of code, either. Loop through your movie clips and throw the switch
that way ...

for (var clip in container) {
if (typeof(container[clip]) == "movieclip") {
container[clip].enabled = false;
}
}


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Jeckyl
3/30/2005 2:12:16 PM
[quoted text, click to view]

Well .. actually they SHOULD of course. .. its just that you don't want them
to in this case.

[quoted text, click to view]

Because the button responds to the mouse, unless there is something over it
that ALSO responds to the mouse. If the front-most objext does not respond
to the mouse, then the next thing behind it gets a chance to respond and so
on until something responds (or there is nothing left)

[quoted text, click to view]

Because you haven't said NOT to make it active.

[quoted text, click to view]

If your clip has mouse actions on it, then it will get the mouse rather than
the button. So there must be something else you're not telling us here.

[quoted text, click to view]

set _enable = false for each button

[quoted text, click to view]

ok ... please be calm .. you'll enjoy life more that way :)

Jeckyl

AddThis Social Bookmark Button