So basically my issue is when I click on my movieClip I want it to spawn this animation I did over the protonCore. Essentially to show that when you click the protonCore you generate 1 proton. However the problem with this when spamming your CLICK, is that when it adds this child on every click, it draws on top of the movieClip and prevents hit detection while the addedChild "fuseSpark" is added to the stage. Is there a way to make it so when I add this child it doesn't affect the hitBox of the clickable movieClip?

    function protonGenerator(e:MouseEvent):void
    {   
        var fuseSpark:MovieClip = new MC_FX_fuse;

        stage.addChild(fuseSpark);

        fuseSpark.x = stage_protonCore.x;
        fuseSpark.y = stage_protonCore.y;
    }
有帮助吗?

解决方案

An easy solution would be to disable the mouse for those children when you create them:

fuseSpark.mouseEnabled = false;

That is, ofcourse, only if you don't care if the user can click those elements.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top