Error using removeChild (AS3)

前端 未结 2 375
臣服心动
臣服心动 2021-01-24 10:41

I am creating a pacman-style game. I am trying to remove an instance of a MovieClip using removeChild(). When the MovieClip instance \"box\" hits the MovieClip instance \"circle

相关标签:
2条回答
  • 2021-01-24 11:31
    if((ScoreObjects[0] as Circle)&&((ScoreObjects[0] as Circle).parent!=null))
    {
       stage.removeChild(ScoreObjects[0]);
    }
    
    0 讨论(0)
  • 2021-01-24 11:31

    I don't have an AS3 compiler at hand to test this, but since you did stage.addChild(ScoreObjects[0]) I believe you should do stage.removeChild(ScoreObjects[0])?

    0 讨论(0)
提交回复
热议问题