actionscript编译提示1046: 找不到类型,或者它不是编译时常数: btn1。 5
这是源码,我是初学者,求大虾指点packagenet.smilecn{importflash.display.SimpleButton;importflash.displ...
这是源码,我是初学者,求大虾指点
package net.smilecn
{
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class MainForm2 extends Sprite
{
public function MainForm2()
{
btn1.addEventListener(MouseEvent.CLICK,insClickHandler);
}
private function insClickHandler(event:MouseEvent):void{
trace("你点击了:",event.currentTarget.name);
btn1.addEventListener(MouseEvent.CLICK,insClickHandler);
btn2.addEventListener(MouseEvent.CLICK,insClickHandler);
event.currentTarget.removeEventListener(MouseEvent.CLICK,insClickHandler);
}
} 展开
package net.smilecn
{
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class MainForm2 extends Sprite
{
public function MainForm2()
{
btn1.addEventListener(MouseEvent.CLICK,insClickHandler);
}
private function insClickHandler(event:MouseEvent):void{
trace("你点击了:",event.currentTarget.name);
btn1.addEventListener(MouseEvent.CLICK,insClickHandler);
btn2.addEventListener(MouseEvent.CLICK,insClickHandler);
event.currentTarget.removeEventListener(MouseEvent.CLICK,insClickHandler);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询