-1
我试图创建一个小型代码,舞台上的两个电影剪辑随机出现在随机位置。我可以随机获得一个物体出现在舞台上。但如何获得第二个对象?这里是我的代码!舞台上两个电影剪辑的Randamisation
var myTimer:Timer = new Timer (1500);
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER, update);
function update(event:TimerEvent) : void
{
trace(Math.floor(Math.random() * 100));
object.x = Math.floor(Math.random() * 300) ;
object.y = Math.floor(Math.random() * 200) ;
//object.alpha = Math.floor(Math.random() * 1);
}
谢谢!
你是如何创建对象以及它们的标识符是什么的? – 2012-08-17 07:15:26