Loaded swf obscuring mouse events in overlapping movieclips

Long time no read. Been busy with a large Flex project, plus I’ve been trying to see a bit more of Europe – but thought it was about time to get back onto some blogging. That and I’ve come up against something that I can’t seem to figure out (and it doesn’t look like anyone else has either from the amount of Googling I’ve done looking for a solution).

Basically what I’m doing is loading an swf with an image in it, which loads over the top of another swf which has some navigation elements in it. What is occurring is the swf on top is preventing any mouseover events from reaching the buttons below the image. I’ve zipped up a test archive to try and illustrate what’s going on. If you run test2.swf, and then mouseover the part of the orange square that intersects the green square, the green squares mouseover event should fire. I’ve set mouseEnabled = false on the orange square, but the fact that it’s in a completely different swf seems to mean that this doesn’t have any effect. The part of green square underneath the orange square is simply not receiving any events.

I’m actually using the Gaia framework, so it’s doing all of the loading of the swf’s. And I thought possibly setting the ApplicationDomain of the swf’s to be the same would mean things would work – but it didn’t. So if anyone’s experienced overlapping assets in two different swf’s interfering with mouse events then please let me know in the comments below.

Please follow and like us:

11 thoughts on “Loaded swf obscuring mouse events in overlapping movieclips”

  1. Good pick up. Not sure I want to disable mouse events for everything in the actual movie clip I am loading however. Your suggestion works fine in the simple example code I’ve posted, but may not in a more complex example.

  2. Loader.mouseEnabled=false is for loader only, and not it’s children (loaded movie clip). When you have active elements in loaded clip they should work.

  3. Pingback: mouse event
  4. Solved – You gotta set the context:

    var mLoader:Loader = new Loader();
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, SecurityDomain.currentDomain);
    var mRequest:URLRequest = new URLRequest(“www.XXXXXXXXXXXXXXXXXX.cc”);
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
    mLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);


Leave a Comment