views:

107

answers:

1

OK. I've got a class (which extends MovieClip) that loads in an external SWF (made in pdf2swf). That is added to another class which has declared doubleClickEnabled = true and I'm listening for DOUBLE_CLICK events.

Problem is when the SWF is loaded my code picks up no DOUBLE_CLICK events, only CLICK events. I've tried it without adding the SWF to the stage and it does pick up DOUBLE_CLICK events.

Anybody come across this before?

class ParentClass{
    ...
    public function ParentClass(){
        ...
        mcToLoadSWF = new MovieClip();
        addChild(mcToLoadSWF);
        doubleClickEnabled = true;
        addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
        ...
    }
}

I've also tried adding the event listener to the mcToLoadSWF as well. No dice.

Cheers Tristian

A: 

What's happening here is that what you are double-clicking is the loaded clip, which is not doubleClickEnabled and therefore the event is not generated, and is not bubbled up to your clip like the other mouse events. Set mouseChildren to false to not send mouse events to the children of your loader, but of course this means that any interactivity in them will not work.

Simon Buchan