# Nested mc Events

**URL:** https://forum.kirupa.com/t/nested-mc-events/168063
**Category:** Uncategorized
**Created:** [November 3, 2005, 4:39pm UTC](https://forum.kirupa.com/t/nested-mc-events/168063 "2005-11-03T16:39:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Chenzo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/chenzo/32/1899_2.png) [@Chenzo](https://forum.kirupa.com/u/Chenzo)
#### Post date: [November 3, 2005, 4:39pm UTC](https://forum.kirupa.com/t/nested-mc-events/168063/1 "2005-11-03T16:39:36Z")

</div>

I know this is a subject that’s been beat to death, but I’m still looking for a better solution than what I’ve got.

Here’s the situation:

on the stage is a movieclip with an instance name of “GraySquare”

within that movie clip is another moiveclip with an instance name of “BlueSquare”

On a blank frame on the stage I’ve got the following action script

```auto
this.GraySquare.onRollOver = function() {
	trace ("Gray!!!");
}

this.GraySquare.BlueSquare.onRollOver = function() {
	trace ("BLUE!!!");
}

```

The GraySquare.onRollOver fires, but the GraySquare.Blue.Square.onRollOver does not, due to the fact of the “nested events problem” where the GraySquare’s events supercede the BlueSquare’s events.

as a work around I can do this:

```auto
this.GraySquare.BlueSquare.onEnterFrame = function() {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)){
			trace("Blue RollOver");
	}
}

```

which is constantly checking for hit detection but it’s VERY processor intensive. Plus without putting some kind of variable stoppage in there, the trace(“Blue RollOver”); fires off over and over and over.

Anyone have any thoughts on this? I had really hoped that Flash 8 was going to have a solution to this but as far as I can tell it does not.

I’m going to attach the FLA here - it’s Flash MX 2004, but I’ve got Flash 8 and I’ll take a Flash 8 solution if you’ve got one.

Thanks

BTW, I just reciently found this message board and it’s quite teh awesome.
