答案 0 :(得分:0)
有很多方法可以达到你想要的效果。一种解决方案可能是拥有一个看不见的鼠标图形,并且每隔X秒就可以看到它。
// the array has all the hole movieclips
var allHoles:Array = new Array('hole1_mc','hole2_mc', 'hole3_mc');
// show a rat 20 times every 2 seconds
var myTimer:Timer = new Timer(2000,20);
myTimer.addEventListener(TimerEvent.TIMER, showRat);
myTimer.start();
function showRat(e:Event):void{
// choose a random hole
var rand = Math.floor(Math.random()*3);
var randomHole = allHoles[rand];
rat_mc.visible = true;
rat_mc.x = randomHole.x;
rat_mc.y = randomHole.y;
}