0
關於閃光CS6 ActionScript 3.0,我得到這個錯誤代碼。Flash CS6錯誤:1084
Scene 1, Layer 'good guy', Frame 1, Line 23 1084: Syntax error: expecting identifier before assign.
這個錯誤是什麼?我不明白。
這是我的代碼。
`import flash.events.MouseEvent;
var mouseIsDown = false;
stage.addEventListener(MouseEvent.MOUSE_DOWN, clicked);
stage.addEventListener(MouseEvent.MOUSE_UP, unclicked);
function clicked (n:MouseEvent)
{
mouseIsDown = true;
}
function unclicked (n:MouseEvent)
{
mouseIsDown = false;
}
addEventListener(Event.ENTER_FRAME, mainLoop);
function mainLoop (e:Event)
{
if (mouseIsDown)
{
gg_mc.y -= 10
}
else
{
gg_mc.y +
= 10
}
for (var I = 0; I < numChildren; I++)
{
if (getChildAt(I) is bad)
{
var b = getChildAt(I) as bad;
if (b.hitTestObject(gg_mc))
{
trace ("You got hit! GAME OVER")
}
}
}
}
在嘗試在此處使用代碼標籤時,可能在開始時意外添加了''。 –