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:
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:
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 ?