質問

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