PDA

View Full Version : disabling buttons...



blah-de-blah
July 8th, 2003, 04:00 PM
I was wondering how you would disable buttons. Iknow there is the code:

movieclip.enabled = false

but this doesn't seem to stop buttons from doing someting when the mouse is rolled over it.

I have 2 movieclips; both with actions which execute on rollover. They also lie on top of each other (but not entirely). When i rollover the top movieclip, the bottom one executes its rollover actions too. I was wondering how to stop this. thx

lostinbeta
July 8th, 2003, 04:35 PM
I am not sure I understand, can you post an example file?

.enabled works for buttons and movie clips.

blah-de-blah
July 8th, 2003, 04:45 PM
ok heres an example...

You will see there are 2 circles which get bigger when you rollover them. If you rollover the point where the green overlaps the grey circle, BOTH circles will get bigger.

I want to stop the grey circle from expanding when you rollOver any part of the green circle. Is that possible? thx

lostinbeta
July 8th, 2003, 04:51 PM
It is because you are using hitTest(), your mouse is in the hit area of the clip so it registers it as a hit.

You can use on handlers on movie clips in Flash MX, so you can do this...

onClipEvent (load) {
this._width = 50;
}
on (rollOver) {
this.onEnterFrame = function() {
this._width += 20;
};
}
on (rollOut) {
delete this.onEnterFrame;
}

On both circles.

blah-de-blah
July 8th, 2003, 04:57 PM
oh ok, i thought of that too, but i thought hitTest had the two options: entire shape and bounding box which would do some other stuff. Anyways thx