Actionscript 2“')'预期”错误
Actionscript 2 " ')' expected" errors
我在基本的闪光灯 class 中,我们必须使用 AS2,而我的老师下周不上学,谁能帮我找出这段代码抛出的语法错误?
var startX:Number = flashMan_mc._x;
var startY:Number = flashMan_mc._y;
var endX:Number = 450;
var endY:Number = 300;
flashMan_mc.onEnterFrame = function()
{
if (flashMan_mc._x < endX && endY)
{
flashMan_mc._x += ((endX – startX)/30);
}
if (flashMan_mc._y < endX && endY)
{
flashMan_mc._y += ((endY – startY)/30);
}
}
这是抛出这些错误:
Scene=Scene 1, layer=actions, frame=1, Line 10 ')' expected
Scene=Scene 1, layer=actions, frame=1, Line 14 ')' expected
Scene=Scene 1, layer=actions, frame=1, Line 15 Unexpected '}' encountered
检查您在第 10 行和第 15 行添加的“-”符号。它们是“-”而不是通常的“-”符号。
尝试删除这些符号并重新输入。
var startX:Number = flashMan_mc._x;
var startY:Number = flashMan_mc._y;
var endX:Number = 450;
var endY:Number = 300;
flashMan_mc.onEnterFrame = function()
{
if (flashMan_mc._x < endX && endY)
{
flashMan_mc._x += ((endX - startX)/30);
}
if (flashMan_mc._y < endX && endY)
{
flashMan_mc._y += ((endY - startY)/30);
}
}
我在基本的闪光灯 class 中,我们必须使用 AS2,而我的老师下周不上学,谁能帮我找出这段代码抛出的语法错误?
var startX:Number = flashMan_mc._x;
var startY:Number = flashMan_mc._y;
var endX:Number = 450;
var endY:Number = 300;
flashMan_mc.onEnterFrame = function()
{
if (flashMan_mc._x < endX && endY)
{
flashMan_mc._x += ((endX – startX)/30);
}
if (flashMan_mc._y < endX && endY)
{
flashMan_mc._y += ((endY – startY)/30);
}
}
这是抛出这些错误:
Scene=Scene 1, layer=actions, frame=1, Line 10 ')' expected
Scene=Scene 1, layer=actions, frame=1, Line 14 ')' expected
Scene=Scene 1, layer=actions, frame=1, Line 15 Unexpected '}' encountered
检查您在第 10 行和第 15 行添加的“-”符号。它们是“-”而不是通常的“-”符号。
尝试删除这些符号并重新输入。
var startX:Number = flashMan_mc._x;
var startY:Number = flashMan_mc._y;
var endX:Number = 450;
var endY:Number = 300;
flashMan_mc.onEnterFrame = function()
{
if (flashMan_mc._x < endX && endY)
{
flashMan_mc._x += ((endX - startX)/30);
}
if (flashMan_mc._y < endX && endY)
{
flashMan_mc._y += ((endY - startY)/30);
}
}