# Stacked objects that both interact with the mouse

**URL:** https://forum.kirupa.com/t/stacked-objects-that-both-interact-with-the-mouse/330317
**Category:** flash
**Created:** [January 1, 2013, 11:20am UTC](https://forum.kirupa.com/t/stacked-objects-that-both-interact-with-the-mouse/330317 "2013-01-01T11:20:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Flivor2012](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Flivor2012](https://forum.kirupa.com/u/Flivor2012)
#### Post date: [January 1, 2013, 11:20am UTC](https://forum.kirupa.com/t/stacked-objects-that-both-interact-with-the-mouse/330317/1 "2013-01-01T11:20:44Z")

</div>

Hi,  
I have an **external SWF** that I load into a **Loader** object.  
I add this Loader object as a child to a MovieClip and add this MovieClip to my stage.  
I now want to draw a **transparent rectangular Sprite on top** of the Loader object, that is just needed to catch mouse event.  
(I need to know when the mouse rolled over and rolled out of the transparent layer).

\*If you’re asking yourself - why do I need this transparent layer and not just catch the events on the Loader itself ? \*  
\*well, there are a lot of reasons for this, most of them have to do with the client requests, but also - because some externally loaded SWFs \*  
_don’t respond to the mouse events for some reason - so I need to ‘trick’ it and add my own transparent layer on top._

My problem is - if I put the transparent layer as a child of the MovieClip that holds the Loader, then I get this hirarchy:  
 ![](http://s7.postimage.org/7hbk3v2yz/child.png)

problem is - mouse events are caught by the top-most layer (the transparent-layer) and passed on to the MovieClip and the Stage.  
The events aren’t fired in the Loader object, and so - the SWF becomes non-interactive.

The other solution would be - to somehow add the transparent layer as a child of the Loader object, like this:  
 ![](http://s9.postimage.org/542j10qun/child2.png)

then the events would be bubbled up to the Loader and the SWF.  
Problem is - Loader class does not allow you to add child elements to it (except for the loaded SWF).

So can anyone offer advice how I can add a transparent layer on top of the SWF and still have mouse interaction with both the transparent layer and the SWF layer ?
