/** 若存入最后的一个参数,即可居中。格式参考此fla 居中:每个最里面的数字对准注册点x中间,但上级必须x为0,导致未初始化是舞台那样,但初始化后这样才好看 **/ import dt_ScoreMain; import flash.events.Event; //数字变化的时间 var changtScoreTime=1; var nowScoreTime=0; //时间到的递增量 var dizengliang:Number=3; //每次增加的分数 var perScore=50; //当前分数 var __scoreNum=0; //当前影片的数字 var changingNum=__scoreNum; var mcWidth:Number=19.2; a.addEventListener("click",addScore); dt_ScoreMain.onGetScoreNumber(changingNum,_targetMc._targetMc,_targetMc.bg); function addScore(e){ __scoreNum+=perScore; //trace(__scoreNum) if(this.hasEventListener(Event.ENTER_FRAME)==false){ this.addEventListener(Event.ENTER_FRAME,efHdl); } } function efHdl(e){ nowScoreTime++; if(nowScoreTime>changtScoreTime){ nowScoreTime=0; changingNum+=dizengliang; if(changingNum>__scoreNum){ changingNum=__scoreNum; this.removeEventListener(Event.ENTER_FRAME,efHdl); return; } dt_ScoreMain.onGetScoreNumber(changingNum,_targetMc._targetMc,_targetMc.bg); } }