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.

Be Sociable, Share!
Tagged with: , ,
Posted in Flash

8 comments on “Loaded swf obscuring mouse events in overlapping movieclips
  1. Ticore says:

    You forgot one key point, Loader is a InteractiveObject also.
    It also has mouseEnabled property.

  2. 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.

  3. mloncaric says:

    Try setting mask on loaded content.

  4. That’s what I ended up doing yesterday after I realised the mouseEnabled property wasn’t working how I expected it to.

  5. foksa says:

    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.

  6. Ian Fuller says:

    I had a similar problem a while back, seemed to be cause by loading a child swf from a non-local resource; http://blog.ifuller1.info/?p=42

  7. Jide says:

    Damn! I’m trying to crack this RIGHT NOW! In my case, it’s 3 levels of loaded clips. Will definitely post solution.

  8. Jide says:

    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);

3 Pings/Trackbacks for "Loaded swf obscuring mouse events in overlapping movieclips"
  1. [...] Loaded swf obscuring mouse events in overlapping movieclips at calm in the chaos blog.wrench.com.au/2009/10/20/loaded-swf-obscuring-mouse-events-in-overlapping-movieclips – view page – cached Flash, Flex and Technology — From the page [...]

  2. [...] original here: Loaded swf obscuring mouse events in overlapping movieclips at … Share and [...]

  3. mouse event says:

    [...] Attribution-Noncommercial 2.5 Mexico License. … 0 Responses to Drawing API and Mouse Events …Loaded swf obscuring mouse events in overlapping movieclips …Categories: Flash Tags: Gaia, mouse events, mouseover. Long time no read. Been busy with a large [...]

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Posts this month
October 2009
« Jul   Jan »