前にちょっとはまったので。。。
mc.addEventListener(Event.ENTER_FRAME, test);
function test(event:Event) :void{
trace(“aaa”);
}
function test(event:Event) :void{
trace(“aaa”);
}
はaaaを出力し続けます。
traceの内容を引数で変えたい場合は、
mc.addEventListener(Event.ENTER_FRAME, test(“bbb”));
function move(str:String) :Function{
return function(event:Event){
trace(str);
}
}
function move(str:String) :Function{
return function(event:Event){
trace(str);
}
}
のようにしないといけないんですね。。。
わかりづら・・・
ちょっとAS3って苦手です。。。
Leave a Reply