Buttontest problem

The attached file contains three clips with an attached script to produce an alpha effect, or there or there abouts.

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
} else {

Problem is when you place mouse over the top clip the clips behind also animate. Simarlarly place the mouse over the secord and the third animates.

How can I prevent this and also build a swap depth command into the script.

Any ideas

see if u can use this one.

I was working on it the other day. You can use large invisible buttons (although I don’t like these) but as in tsavos example it works ok, except the hit state of the middle layer overlaps the first. I’m going to have another look at it when I can unless it’s sorted by then.

found a tut about the swap thing! that improved it a little!!

You were right in using swap depths, but I used in a simpler way try this. Just need to increase the hit area if required and make it invisible

He he!THAT is simpler!! MY way was for flash 5 I think!

Where u put 100 thats to represent the number of clips right? so in this case it would be enough to type 3?
U know some good url’s with tut, that I’ve overlooked?!

100 represents the new depth.


the higher newDepth is (how do I describe it) the higher it will be, eg, an object with depth 2 will appear over an object with depth 1.

There are good tutorials on this site, but check out actionscript.org and moock.org (for up to date mx tips).