또 다른 바보 같은 질문입니다. 튜토리얼 (Richard Parnaby-King의 게임을 터지는 게임)을 따랐습니다.rightparen 앞에 콜론이 있어야하고 이전에 식별자가 있어야합니다.
나는이 어려운 오류가있어 문제가 해결되었다.
main.as (라고 TEST1) :
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.utils.Timer;
[SWF(width='800',height='600',backgroundColor='#FFFFFF',frameRate='25')]
public class Test1 extends MovieClip
{
var icon:FacebookIcon = new FacebookIcon();
var background:BG = new BG();
private var timer:Timer = new Timer(5000,-1);
private var bubbles:Array = [];
private var score:int;
private var textBox:TextField = new TextField;
private var textFormat:TextFormat = new TextFormat(null, 30);
public function Test1(); void
{
if(stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
//add start button
icon.addChild(new StartButton());
icon.addEventListener(MouseEvent.CLICK, startGame);
icon.buttonMode = true;
icon.x = (stage.stageWidth/2) - (icon.width/2);
icon.y = (stage.stageHeight/2) - (icon.height/2);
addChild(icon);
textBox.defaultTextFormat = textFormat;
private function startGame(e:MouseEvent):void {
icon.removeEventListener(MouseEvent.CLICK, startGame);
removeChild(icon);
removeChild(background);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, createBubble);
timer.start();
createBubble();
score = 0;
}
내가 얻을 오류 1084 : 구문 오류 : 예상 식별자 전의 경우
및
-1084 : 구문 오류 : 오른쪽 괄호 앞에 콜론이 있어야합니다.
오른쪽 어디
무엇이 잘못 되었습니까? 모든 것을 시도했다. 감사합니다.
클래스 및 패키지와 init 메소드에서 누락 된 중괄호 괄호 중 하나는 복사 및 붙여 넣기 오류입니까? – BadFeelingAboutThis