: //amount代表數量
: var amount = 0;
: var roachShow;
: function setRoach() {
: amount = amount+1;
: if (amount>100) {
: clearInterval(roachShow);
: } else {
: roach_mc.duplicateMovieClip("roach"+amouny, amount);
: setProperty("roach"+amount, _x, 20+random(510));
: setProperty("roach"+amount, _y, 400);
: }
: }
: roachShow = setInterval(setRoach,1000);
這裡少寫入一個參數 因該寫成:
roachShow = setInterval(this,"setRoach",1000)
this在這是代表物件範圍
: mouse_mc.onPress = function() {
: };
: stop();
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.167.211.38