-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