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.
You forgot one key point, Loader is a InteractiveObject also.
It also has mouseEnabled property.
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.
Try setting mask on loaded content.
That’s what I ended up doing yesterday after I realised the mouseEnabled property wasn’t working how I expected it to.
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.
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
Damn! I’m trying to crack this RIGHT NOW! In my case, it’s 3 levels of loaded clips. Will definitely post solution.
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);
mLoader.load(mRequest,context);