« Sandy 3D engine v3.0.1 | メイン | そろそろ文字コードは統一してほしいな。 »

2008年1月28日

[as2] ループ処理とイベントハンドラ

Yoropan@Flaさんのブログ記事にコメントしたら失敗してしまいました。
http://yoropan.no.coocan.jp/wp/index.php/archives/85#comment-31

ここにコメントで書こうとしたソースを掲載しておきます。

Yoropan@Flaの筆者さん、すいませんでした。

var arr:Array = [0,1,2];

for(var i=0; i<arr.length; i++){
  var names="hoge"+i;
  var box_mc = this.createEmptyMovieClip(names,i)
  box_mc.i=i;
  box_mc.onRelease=function(){
    box_mc.name=arr[this.i];
    trace("--release event");
    trace("box_mc.name = "+box_mc.name);
    trace("hoge0.name = "+hoge0.name);
    trace("hoge1.name = "+hoge1.name);
    trace("hoge2.name = "+hoge2.name);
    trace("box_mc = "+box_mc);
    trace("this = "+this);
    trace("");
  }
  fillRect( box_mc );
  box_mc._x = i*110;
}
trace([i,box_mc]);

function fillRect( mc )
{
  var x = 100;
  mc.beginFill(0,100);
  mc.moveTo(0,0); mc.lineTo(x,0);
  mc.lineTo(x,x); mc.lineTo(0,x);
}

トラックバック(0)

このブログ記事を参照しているブログ一覧: ループ処理とイベントハンドラ

このブログ記事に対するトラックバックURL: http://system.seyself.com/mt-tb.cgi/474

コメント(2)

Each and every drug has some contraindications, sometimes Viagra, which is very much very, very good remedy for impotence problems. Men very happy to take him again, then again, and also this drug has several problems, just not at all times true, what will i say, I think he was superior, nonetheless, provides some contraindications, like practicly all medicines in the marketplace. Men affected by cardiovascular disease, a new history of cardiovascular attacks and cerebral vascular accidents, are not able to make normal intercourse. Including lovemaking to be reckoned together with, but they can not use. Viagra. Viagra, after expanding the complete cavernous, allowing the same to kayak affordable the blood towards them, that might charge the circulatory process. Hence it isn't feasible to charge of sexual activity. Viagra is an extremely effective drug, I would recommend it to all who desires to make really like without restriction. When you take Viagra, it really is worthwhile, nevertheless, consult a family doctor or pharmacist. Without using Viagra, is often very harmful plus cause more injury than good.

Hagchancy

naturally lower cholesterol Boivyintono

コメントする


画像の中に見える文字を入力してください。

しばらく時間が経過すると、システム内部と表示されている文字内容に食い違いが発生するようなので、
投稿する前にページをリロードすることをお勧めします。
リロードしてもフォームの内容は維持されます。