非空检测以及影片剪辑元件调用内部元件
源码
stop();import fl.motion.MotionEvent;import flash.events.MouseEvent;import flash.display.MovieClip; //需要引入命名空间/也是一个类,自定义类定义完毕以后如果要引用也需要这样引用var IsAorB:Boolean=true;BT01.addEventListener(MouseEvent.CLICK, Play01);BT02.addEventListener(MouseEvent.CLICK, Play02);Bt_zanting.addEventListener(MouseEvent.CLICK, Zanting);Bt_stop.addEventListener(MouseEvent.CLICK, Stop);Bt_play.addEventListener(MouseEvent.CLICK, Goon);//--------------函数function Zanting(e: MouseEvent) {//this.stop();if(IsAorB){MC_energy.stop();MC_arrowB.stop();MC_arrowA.stop();}else{MC_ZHISHI.stop();if(MC_ZHISHI.MC_canshuEnergysphere!=null){MC_ZHISHI.MC_canshuEnergysphere.stop();MC_ZHISHI.MC_canshuEnergysphere.MC_JIANTOU01.stop();MC_ZHISHI.MC_canshuEnergysphere.MC_JIANTOU02.stop();}}}function Goon(e: MouseEvent) {if(IsAorB){MC_energy.play();MC_arrowB.play();MC_arrowA.play();}else{MC_ZHISHI.play();if(MC_ZHISHI.MC_canshuEnergysphere!=null){MC_ZHISHI.MC_canshuEnergysphere.play();MC_ZHISHI.MC_canshuEnergysphere.MC_JIANTOU01.play();MC_ZHISHI.MC_canshuEnergysphere.MC_JIANTOU02.play();}}}function Play01(e: MouseEvent) {this.gotoAndStop(2);IsAorB=true;}function Play02(e: MouseEvent) {this.gotoAndStop(5);IsAorB=false;}function Stop(e: MouseEvent) {this.gotoAndStop(1);}