嗨,创建一个迷宫游戏,并认真无法弄清楚如何解决这个问题(我是AS3的新手):)

时间:2015-03-12 11:24:50

标签: actionscript-3

addEventListener(Event.ENTER_FRAME, hitTest);

hitTest(evt:Event) 
 (Character.hitTestPoint(mouseX, mouseY, true)
 {
    MovieClip(this.root).gotoAndPlay(1, "Main Menu");
 }

不断收到错误

  • Level 1, Layer 'Actions', Frame 8, Line 3, Column 13 1084: Syntax error: expecting rightparen before colon
  • Level 1, Layer 'Actions', Frame 8, Line 5, Column 3 1084: Syntax error: expecting rightparen before leftbrace

1 个答案:

答案 0 :(得分:0)

function hitTest(evt:Event) {
   if(Character.hitTestPoint(mouseX, mouseY, true))
   {
     MovieClip(this.root).gotoAndPlay(1, "Main Menu");
   }
}