gpt4 book ai didi

actionscript-3 - 语法错误: expecting identifier before this. expecting colon before leftparen. expecting identifier before rightbrace

转载 作者:行者123 更新时间:2023-12-03 08:28:37 29 4
gpt4 key购买 nike

Scene 1, Layer 'script', Frame 1, Line 9    1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 9 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 10 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 16 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 16 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 17 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 23 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 23 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 24 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 30 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 30 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 31 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 37 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 37 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 38 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 44 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 44 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 45 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 51 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 51 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 52 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 58 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 58 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 59 1084: Syntax error: expecting identifier before rightbrace.
Scene 1, Layer 'script', Frame 1, Line 65 1084: Syntax error: expecting identifier before this.
Scene 1, Layer 'script', Frame 1, Line 65 1084: Syntax error: expecting colon before leftparen.
Scene 1, Layer 'script', Frame 1, Line 66 1084: Syntax error: expecting identifier before rightbrace.

这些错误(其中27个)显示出来,并且我的stop命令不起作用,我的代码怎么了?我是Flash ActionScript 的新手,我使用了YouTube教程来创建我引用的按钮(knapp)。

这是我的代码
stop();

//knappane til dei forskjellige planetane

//solen
solenKnappen.addEventListener(MouseEvent.CLICK, goToSolen);

function goToSolen(event: MouseEvent);void {
this.gotoAndStop("solen")
}

//merkur
merkurKnappen.addEventListener(MouseEvent.CLICK, goToMerkur);

function goToMerkur(event: MouseEvent);void {
this.gotoAndStop("merkur")
}

//venus
venusKnappen.addEventListener(MouseEvent.CLICK, goToVenus);

function goToVenus(event: MouseEvent);void {
this.gotoAndStop("venus")
}

//jorden
jordenKnappen.addEventListener(MouseEvent.CLICK, goToJorden);

function goToJorden(event: MouseEvent);void {
this.gotoAndStop("jorden")
}

//mars
marsKnappen.addEventListener(MouseEvent.CLICK, goToMars);

function goToMars(event: MouseEvent);void {
this.gotoAndStop("mars")
}

//jupiter
jupiterKnappen.addEventListener(MouseEvent.CLICK, goToJupiter);

function goToJupiter(event: MouseEvent);void {
this.gotoAndStop("jupiter")
}

//saturn
saturnKnappen.addEventListener(MouseEvent.CLICK, goToSaturn);

function goToSaturn(event: MouseEvent);void {
this.gotoAndStop("saturn")
}

//uranus
uranusKnappen.addEventListener(MouseEvent.CLICK, goToUranus);

function goToUranus(event: MouseEvent);void {
this.gotoAndStop("uranus")
}

//neptun
neptunKnappen.addEventListener(MouseEvent.CLICK, goToNeptun);

function goToNeptun(event: MouseEvent);void {
this.gotoAndStop("neptun")

最佳答案

您的代码错误是使用分号(;)指示函数的类型而不是使用冒号(:)时,因此,例如,goToSolen()函数的代码应如下所示:

function goToSolen(event: MouseEvent): void 
{
this.gotoAndStop("solen");
}

当然,您应该使用所有功能执行此操作。

有关ActionScript 3中功能的更多信息,请查看 here

希望能对您有所帮助。

关于actionscript-3 - 语法错误: expecting identifier before this. expecting colon before leftparen. expecting identifier before rightbrace,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33391275/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com