访问未定义的属性

时间:2015-10-19 16:19:38

标签: javascript actionscript-3 flash

有人可以帮我找出为什么我收到错误消息“访问未定义的属性:无效&指望以下剪切?

import flash.events.MouseEvent;    
invalid.visible = false;    
txtNumber.restrict = "0-9";    
var sum:Number = 0

btnCount.addEventListener(MouseEvent.CLICK, count);

btnReset.addEventListener(MouseEvent.CLICK, reset);
{

     function add (evt:MouseEvent)
     {
         sum=sum+Number (txtNumber.text);
         txtSum.text=String(sum)
     }
     function reset (MouseEvent)
     {
         sum=0;   
         txtNumber.text = "0"    
         txtSum.text = "0"
     }

     if (txtSum.text=="NaN"){
         invalid.visible=true;
     }
}

0 个答案:

没有答案