close
大大好,請看下列作法是不是你要的
檢視圖片
for(i=0; i<10; i++){
this.attachMovie("show", "s"+i, this.getNextHighestDepth(), {_x:Math.random()*Stage.width, _y:Math.random()*Stage.height});
}
註:
一、for(i=0; i<10; i++) 表示貼上10個星星
二、 "s"+i 代表新增星星的「實體名」
三、this.getNextHighestDepth() 代表新增星星星的「深度」
四、_x:Math.random()*Stage.width 代表在「舞台內」任意「橫座標」
五、_y:Math.random()*Stage.height 代表在「舞台內」任意「縱座標」
檢視圖片
for(i=0; i<10; i++){
this.attachMovie("show", "s"+i, this.getNextHighestDepth(), {_x:Math.random()*Stage.width, _y:Math.random()*Stage.height});
}
註:
一、for(i=0; i<10; i++) 表示貼上10個星星
二、 "s"+i 代表新增星星的「實體名」
三、this.getNextHighestDepth() 代表新增星星星的「深度」
四、_x:Math.random()*Stage.width 代表在「舞台內」任意「橫座標」
五、_y:Math.random()*Stage.height 代表在「舞台內」任意「縱座標」
全站熱搜
留言列表