请问这个定义类有什么问题
为什么我定义的属性在后面全部是未定义的?谢谢指教
class landByMouse{
var allrat=12,time=60,score=0,highscore=60,lowscore=15,loop=0;
function timeshow() //设置计时器
{
_root.time=_root.time-1;
}
function ratshow() //随机显示一只地鼠
{
loop=loop+1;
trace(loop);
var mouse_x=Math.floor(Math.random()*550)+1;
var mouse_y=Math.floor(Math.random()*400)+1;
_root.removeMovieClip("landMouse","landMouse"+loop,loop);
_root["landMouse"+loop]._x=mouse_x;
_root["landMouse"+loop]._y=mouse_y;
}
/* function hammer() //锤子动作
{
if(_root.hitMouse.hitTest(_root.landMouse)){
_root.score=_root.score+1;
_root.landMouse.gotoAndPlay("hit");
}
}*/
function hideMouse() //设置光标为锤子
{
Mouse.hide();
_root.hammer.startDrag(true);
_root.onMouseDown=function() {
_root.hammer.gotoAndPlay(2);
}
_root.onMouseUp=function(){
_root.hammer.gotoAndPlay(1);
}
/* _root.box.onMouseMove=function(){
updateAfterEvent();
}*/
}
function mouseAction() //控制地鼠
{
loop=0;
for(var i=1;i<=allrat;i++)
{
_root["landMouse"+i]._visible=false;
}
var intervaltime=Math.floor(Math.random()*500)+500;
var ratshowlap=setInterval(ratshow,intervaltime);
var timelap=setInterval(timeshow,1000);
_root.createEmptyMovieClip("box",0);
_root.box.onEnterFrame=function(){
if(time<=0)
{
clearInterval(_root.timelap);
clearInterval(_root.ratshowlap);
_root.gotoAndStop(3);
}
}
hideMouse();
}
}