假设你用的是AS3,然后这个元件为影片剪辑,实例名为btn_clear,代码写到主时间轴的帧上,代码如下:
import flash.events.MouseEvent;btn_clear.addEventListener(MouseEvent.CLICK,ClearAllEvent);function ClearAllEvent(e:MouseEvent):void{ while(stage.numChildren>0) { stage.removeChildAt(0); }}