buttonactionscriptactionscript-2

AS2 - ActionScript2 - onPress on motionclip children


I have some trouble with some motionclip. I got a scene with inside a motionclip which has a motionclip inside with a motionclip inside too.

like: mc.bar.arrow

I would like to have onPress on mc and onPress on arrow. But whatever I done the onPress on arrow (or bar, I have tested) is never call. The one on mc is well called.

I suspect a system of raycast blocker like a Unity UI System, but found nothing on the subject

Have you any idea?

note: I am totally newbie in AS2 and I cannot upgrade to AS3


Solution

  • I have use a turn around, when I do onPress on the movieClip father I detect if the mouse is hover the child with this function and call the function onPress of the child if mouse effectivly hover. It's bad and not scalable but in my case it's ok. I put it at answer until got one better

    function detectMouseHover(target:MovieClip):Boolean
    {
        return target.hitTest(_root._xmouse, _root._ymouse,true );
    }
    

    EDIT : See that wich is really interresting : http://www.senocular.com/flash/tutorials/buttoncapturing/