私はAS 3で簡単なプログラムを作ろうとしています. x = 200、これは私の簡単なコードです:
var hero:Hero = new Hero();
hero.x = 0;
hero.y = 300;
addChild(hero);
addEventListener(Event.ENTER_FRAME, animateHero);
function animateHero(event:Event) {
if (hero.x <= 200){
hero.play();
} else {
hero.currentFrame(stop);
}
hero.x += 2;
}
このコードを試してみると、実行中ですが、出力パネルにエラーメッセージが繰り返し表示されます:
TypeError: Error #1006: value is not a function.
at SpriteMovement_fla::MainTimeline/animateHero()
私の質問 :
私のコードは間違っていますか? 間違っている場合は、正しいコードを教えてください。