Меню

1084 синтаксическая ошибка rightbrace перед end of program

So I keep getting this error, debugger wont run but rather just shows this error in a compiler box.
Thing has been driving me crazy for days now so I decided to post it here.

So it says:

Scene 1, Layer 'powerups', Frame 1  1084: Syntax error: expecting rightbrace before end of     program.

I designed my code so that the «powerups» layer contains only «powerup» functions,
heres the code from «Powerups» layer:

//this code holds the powerups
function extraCoins():void
{
    coins = coins + 1000;
}

function doubleCoins():void
{
    doubCoins = true;
}

function hyperBoostD():void
{
    Boost = 600;
    playerSpeed = playerSpeed + 150;
    player.y = player.y + 300;
    colBoolean = false;
    hyperBoost.push(Boost);
}

function BoostD():void
{
    Boost = 200;
    playerSpeed = playerSpeed + 100;
    player.y = player.y + 200;
    colBoolean = false;
    boost.push(Boost);
}

function multiplierDone():void
{
    multiplier++;
}

function multiplierDtwo():void
{
    multiplier = multiplier + 2;
}

function watchOutD():void
{
    watchOut = true;
    watchOutT = 600;
}

function blowOutD():void
{
    blowOut = true;
    blowOutT = 100;
}

function planeD():void
{
    planeT = 600;
    colBoolean = false;
}

function havenD():void
{
    havenT = 200;
    coinMake = 20;
}

function badBirdD():void
{
    birdT = 600;
    birdSet = 10;
}

function tricksterD():void
{
    tricksterT = 600;
    trickster = true;
}

function rampageD():void
{
    rampageT = 600;
    rampage = true;
    pplStat = true;
    var tempWatchoutPPL:MovieClip;
    tempWatchoutPPL = new peopleWatchout();
    tempWatchoutPPL.y = stage.stageHeight /2;
    tempWatchoutPPL.x = stage.stageWidth /2;
    addChild(tempWatchoutPPL);
    signs.push(tempWatchoutPPL);
}

function helpPPLD():void
{
    helpPPLT= 600;
    helpPPL = true;
    var tempHelpPPL:MovieClip;
    tempHelpPPL = new savePpl();
    tempHelpPPL.y = stage.stageHeight /2;
    tempHelpPPL.x = stage.stageWidth /2;
    addChild(tempHelpPPL);
    signs.push(tempHelpPPL);
}

And here is my main code :

import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.text.engine.SpaceJustifier;
import flashx.textLayout.operations.MoveChildrenOperation;
import flash.utils.Timer;
import flashx.textLayout.accessibility.TextAccImpl;

/*
CODE BY: 
START DATE: 12.06.2013.
FINISH DATE: TBA

NOTE: My secound video game ever.

BUGs:
-obsticle collison stops working after some time playing
-passing coin gives you more than 5 coins
*/

/***..........................VARs.........................................................................***/
    var STATE_START:String="STATE_START";
    var STATE_START_PLAYER:String="STATE_START_PLAYER";
    var STATE_PLAY:String="STATE_PLAY";
    var STATE_END:String="STATE_END";
    var gameState:String;

    //Player
        var player:MovieClip;
        var playerSpeed:Number;
        var speedLimit:Number;
        var speedLimitInc:Number;

    //score
        var score:Number= 1;
        var scoreInc:Number= 1;

    //coins
        var coins:Number= 1;
        var balance:Number;
        var coinCount:Number= 1;
        var Coins:Array;
        var doubCoins:Boolean = false;
        var multiplier:int = 1;
        var coinMake:Number = 60;

    //distance
        var meters:Number= 1;
        var distance:Number= 1;

    //holds drops
        var drops:Array; 

    //terrain
            //decides spawning time
        var GenS:Number=1;
            //holds terrain
        var terrain:Array;

    //boost
            //holds the speedBoosts that are happening
        var boost:Array;
            //holds boost dysp obj.
        var booost:Array;
            //holds speedBoost duration
        var Boost:Number;
            //collision on/off
        var colBoolean:Boolean=true;
        var hyperBoost:Array;

    //obsticles
        var obsticles:Array;

    //other
        var level:Number= 1;
        var levelCount:Number= 1;
        var birdArray:Array;
        var jumpState:Boolean = false;
        var jumpStateT:int;
        var jumps:Array;

    //powerUps
        var watchOut:Boolean = false;
        var watchOutT:int;
        var blowOut:Boolean = false;
        var blowOutT:int;
        var planeT:int;
        var birdT:int;
        var birdSet:int = 300;
        var havenT:int;
        var trickster:Boolean = false;
        var tricksterT:int;
        var ppl:Array;
        //pplStat tells if ppl are getting hurt or need help, if ture, it means you are gonna run them over
        var pplStat:Boolean = true;
        var rampage:Boolean;
        var rampageT:int;
        var helpPPLT:int;
        var helpPPL:Boolean;
        var signs:Array;


/***.......................Display SETUP...................................................................***/
    homeScreen.visible = true;
    gamePlay.visible = false;
    endScreen.visible = false;

/***........................Start Screen...................................................................***/
    homeScreen.play_BTN.addEventListener(MouseEvent.CLICK, clickPlay);
    homeScreen.settings_BTN.addEventListener(MouseEvent.CLICK, clickSettings);
    function clickPlay(event:MouseEvent):void
    {
        //Move main screen from stage
        homeScreen.visible = false;

        //Begin loading the game
        gameState = STATE_START;
        trace (gameState);
        addEventListener(Event.ENTER_FRAME, gameLoop);
    }

    function clickSettings(event:MouseEvent):void
    {
        //Move main screen from stage
        homeScreen.visible = false;
        //settingsScreen.visible...
    }


/***...........................Game LOOP...................................................................***/

    function gameLoop(e:Event):void
    {
        switch(gameState)
        {
            case STATE_START:
                startGame();
                break;

            case STATE_START_PLAYER:
                startPlayer();
                break;

            case STATE_PLAY:
                playGame();
                break;

            case STATE_END:
                endGame();
                break;

        }
    }


/***...............STATE_START.............................................................................***/

    function startGame():void
    {
        level = 1;
        playerSpeed = 1;
        speedLimit = 10;
        speedLimitInc = 1;

        //Graphics
            //coins
        Coins = new Array();
            //player icon
        player = new Player(); 
            //start obsticles array
        obsticles = new Array();
            //holds terrain (speedUps, jupms, etc)
        terrain = new Array();
            //holds speedUps
        boost = new Array();
        booost = new Array();
        hyperBoost = new Array();
            //other
        drops = new Array();
        birdArray = new Array();
        jumps = new Array();
        ppl = new Array();
        signs = new Array();

        gameState = STATE_START_PLAYER;
        trace(gameState);
    }

/***....................STATE_START_PLAYER................................................................***/

    function startPlayer():void
    {
        //start the player
        //set possition of player
        player.y = player.height + 10;
        addChild(player);
        addEventListener(Event.ENTER_FRAME, movePlayer);

        //changing screens

        //start game
        gameState = STATE_PLAY;
        trace(gameState);


    }

    //player controll
    function movePlayer(e:Event):void 
    {
        //mousetouch recognition
        player.x = stage.mouseX;

        //making sure player does not move out of the stage
        if (player.x < 0)
        {
            player.x = 0;
        }
        if (player.x > (stage.stageWidth - 2/player.width))
        {
            player.x = stage.stageWidth + 2/player.width;
        }
    }

/***............................STATE_PLAY................................................................***/
    function playGame():void
    {
        if (watchOutT <= 0) {watchOut = false}
        if (blowOutT <= 0) {blowOut = false}
        if (planeT <= 0) {colBoolean = true}
        if (tricksterT <= 0) {trickster= false}
        if (havenT <= 0) {coinMake = 60}
        if (birdT <= 0) {birdSet = 300}
        if (planeT >= 0) {planeT--} birdT
        if (havenT >= 0) {havenT--}
        if (birdT >= 0) {birdT--}
        if (tricksterT >= 0) {tricksterT--}
        speedUp();
        metersCount();
        scoreCount();
        makeCoins();
        moveCoins();
        makeTerrain();
        moveDrop();
        makeBird();
        moveBird();
        moveJump();
        moveSigns();
        movePPL();
        stunts();
        //speed boost
        moveSpeedBoost();
        //obsticles
        moveObsticle();
    }

    function metersCount():void
    {
        meters = meters + playerSpeed;
        distance = meters / 50;
        if (distance >= 1000 && distance <= 1200)
        {
            levelCount= 1000; 
            level = 2; 
        }
        if (distance >= (levelCount + 1000) && distance <= (levelCount + 1200))
        {
            level++;
            levelCount= levelCount + 1000;
        }
        trace("level", level);
        trace("meters", meters);
        trace("coins", coins);
        trace("distance", distance);
    }

    function scoreCount():void
    {
        if (scoreInc >= 30) { score++; scoreInc=1; trace("-score", score); }
        scoreInc++
    }

    function makeCoins():void
    {
        trace("coinCount", coinCount);
        if (coinCount == coinMake) 
        {
            var tempCoin:MovieClip;
            //generate enemies
            tempCoin = new Coin();
            tempCoin.speed = playerSpeed;
            tempCoin.x = Math.round(Math.random()*400);
            tempCoin.y = stage.stageHeight;

            addChild(tempCoin);
            Coins.push(tempCoin);
            coinCount = 1;
        }
        coinCount++;
    }

    function moveCoins():void
    {
        var j:int;
        var tempCoin:MovieClip;
        for(var i:int = Coins.length-1; i>=0; i--)
        {
        tempCoin = Coins[i];
        tempCoin.y = tempCoin.y - playerSpeed;
        }

        //testion colision with the player and screen out
        if (tempCoin != null)
        {
            if (tempCoin.y > stage.stageHeight)
            {
                removeCoin(i);
            }
            if (tempCoin.hitTestObject(player))
            {
                if (i != j && doubCoins == false) {coins = coins + 5; j = i;}
                if (i != j && doubCoins == true) {coins = coins + 10; j = i;}
                removeCoin(i);
            }
        }
    }
    function speedUp():void
    {
        trace ("speed", playerSpeed);
        //checks if any boosts are on
        var k:Boolean;
        //making speed limit
        if (playerSpeed < speedLimit)
        {
            playerSpeed ++;
            if (k == true) {j++}
        }

        //increasing speed limit
        if (speedLimitInc == 100)
        {
            speedLimit ++;
            speedLimitInc = 1;
        }
        speedLimitInc ++;


        var j:Number;
        j = playerSpeed;
        for (var i:int = boost.length-1; i>=0; i--)
        {
            if (tempBoostN >= 0)
            {k = true; colBoolean = true;}
            else 
            {
                k = false;
                player.y = player.height + 30;
            }
            var tempBoostN = boost[i];
            if (playerSpeed >= j)
                {
                if (tempBoostN >= 150)
                {
                    playerSpeed = playerSpeed -1;

                } else if (tempBoostN <= 150 && tempBoostN >= 30) {
                    playerSpeed = playerSpeed - 2;
                }
                tempBoostN--;
            }
        }

        var l:Number;
        l = playerSpeed;
        for (var i:int = boost.length-1; i>=0; i--)
        {
            if (tempBoostN >= 0)
            {k = true; colBoolean = true;}
            else 
            {
                k = false;
                player.y = player.height + 30;
            }
            var tempBoostH = hyperBoost[i];
            if (playerSpeed >= l)
                {
                if (tempBoostH >= 150)
                {
                    playerSpeed = playerSpeed -1;

                } else if (tempBoostN <= 150 && tempBoostH >= 30) {
                    playerSpeed = playerSpeed - 2;
                }
                tempBoostH--;
            }
        }
    }

    function makeBos():void
    {
        var tempBoost:MovieClip;

        tempBoost = new speedPod();
        if (tempBoost != null)
        {
            tempBoost.y = stage.stageHeight;
            tempBoost.x = Math.round(Math.random()*400);
            booost.push(tempBoost);
            var i = getChildIndex(player);
            addChild(tempBoost);
            setChildIndex (tempBoost, i);
        }
    }

    function moveSpeedBoost():void
    {
        var tempBoost:MovieClip;
        for(var i:int = booost.length-1; i>=0; i--)
        {
            tempBoost = booost[i];
            tempBoost.y = tempBoost.y - playerSpeed;
        }

        //test if Boost is off-stage and set it to remove
        if (tempBoost != null && tempBoost.y < stage.stageHeight)
        {
            removeSpeedBoost(i);
        }

        //player-Boost colision
        if (tempBoost != null && tempBoost.hitTestObject(player))
        {
            Boost = 200;
            playerSpeed = playerSpeed + 100;
            player.y = player.y + 200;
            colBoolean = false;
            boost.push(Boost);
        }
    }

    function makeTerrain():void
    {
        if (GenS == 29)
        {
            GenS = 1;
            var genType:Number = Math.floor(Math.random()*100);

            //POWERUPS
                //handling watchout powerup
                if (watchOut = true){watchOutT--; makeObs();}
                //handling blowout powerup
                if (blowOut = true){blowOutT--;}
                //handling trickster powerup
                if (trickster = true){makeJump();}
                //handling rampage powerup
                if (rampage = true){makePPL(0); rampageT--;}
                //handling hurtPPL powerup
                if (hurtPPL = true){makePPL(1); hurtPPLT--;}

            //general spawning
            if (genType >= 1 && genType <=20 && watchOut == false && blowOut == false && trickster == false)
            {
                trace("makeObs");
                makeObs();
            }else if (genType >= 20 && genType <=60 && watchOut == false && blowOut == false && trickster == false)
            {
                trace("makeBos");
                makeBos();
            }else if (genType >= 60 && genType <=65 && watchOut == false && blowOut == false && trickster == false)
            {
                trace("makeDrop");
                makeDrop();
            }else if (genType >= 65 && genType <=100 && watchOut == false && blowOut == false && trickster == false)
            {
                trace("make jump");
                makeJump();
            }
        }
        GenS++;
    }

    function makeObs():void
    {
        var tempObs:MovieClip;
        //determining the type of an obsticle
        var typeObs:Number = Math.floor(Math.random()*3);
        switch (typeObs)
        {
            case 0:
                tempObs = new wLog();
                break;
            case 1:
                tempObs = new Spill();
                break;
            case 2:
                tempObs = new wTree();
                break;
        }
        if (tempObs != null)
        {
            tempObs.y = stage.stageHeight;
            tempObs.x = Math.round(Math.random()*400);
            addChild(tempObs);
            obsticles.push(tempObs);
        }
    }

    function makePPL():void
    {
        var tempPPL:MovieClip;
        if (hurtPPL = true)
        {tempPPL = new personHurt();}
        else {tempPPL = new person();}
        tempPPL.y = stage.stageHeight;
        tempPPL.x = Math.round(Math.random()*400);
        addChild(tempPPL);
        ppl.push(tempPPL);
    }

    function movePPL():void
    {
        //move enemies
        var tempPPL:MovieClip;
        for(var i:int = ppl.length-1; i>=0; i--)
        {
            tempPPL = ppl[i];
            tempPPL.y = tempPPL.y - playerSpeed;
        }

        //test if obsticle is off-stage and set it to remove
        if (tempPPL != null && tempPPL.y < stage.stageHeight)
        {
            removePPL(i);
        }

        //player-obsticle colision
        if (tempPPL != null && tempPPL.hitTestObject(player) && hurtPPL = true)
        {
            score = score + 1000;
            coins = coins + 1000;
            var tempSaved:MovieClip;
            tempSaved = new savedPerson();
            tempSaved.y = stage.stageHeight /2;
            tempSaved.x = stage.stageWidth /2;
            addChild(tempSaved);
            signs.push(tempSaved);
            trace ("person saved");
            removePPL(i);

        } else if (tempPPL != null && tempPPL.hitTestObject(player)) 
        {
            score = score - 1000;

            var tempRanOver:MovieClip;
            tempRanOver = new ranOver();
            tempRanOver.y = stage.stageHeight /2;
            tempRanOver.x = stage.stageWidth /2;
            addChild(tempRanOver);
            signs.push(tempRanOver);
            trace ("ran over a person");
            removePPL(i);
        }
    }

    function moveSigns():void
    {
        //move enemies
        var tempSign:MovieClip;
        for(var i:int = signs.length-1; i>=0; i--)
        {
            tempSign = signs[i];
            tempSign.y = tempSign.y - playerSpeed;
        }

        //test if obsticle is off-stage and set it to remove
        if (tempSign != null && tempSign.y < stage.stageHeight)
        {
            removeSign(i);
        }
    }

    function makeDrop():void
    {
        var tempDrop:MovieClip;
        tempDrop = new Drop();
        tempDrop.y = stage.stageHeight;
        tempDrop.x = Math.round(Math.random()*400);
        addChild(tempDrop);
        drops.push(tempDrop);

    }

    function moveDrop():void
    {
        //move enemies
        var tempDrop:MovieClip;
        for(var i:int = drops.length-1; i>=0; i--)
        {
            tempDrop = drops[i];
            tempDrop.y = tempDrop.y - playerSpeed;
        }

        //test if obsticle is off-stage and set it to remove
        if (tempDrop != null && tempDrop.y < stage.stageHeight)
        {
            removeDrop(i);
        }

        //player-obsticle colision
        if (tempDrop != null && tempDrop.hitTestObject(player))
        {
            powerUp();
        }
    }

    function makeBird():void
    {
        if (distance >= 200)
        {
            var chance:Number = Math.floor(Math.random()*birdSet);
            if (chance <= 1 + level) 
            {
                var tempBird:MovieClip;
                //generate enemies
                tempBird = new BirdO();
                tempBird.speed = 60 + playerSpeed;
                tempBird.x = Math.round(Math.random()*400);

                addChild(tempBird);
                birdArray.push(tempBird);
            }
        }
    }

    function moveBird():void
    {
        var tempBird:MovieClip;
        for(var i:int = birdArray.length-1; i>=0; i--)
        {
            tempBird = birdArray[i];
            tempBird.y -= tempBird.speed;
            }

        if (tempBird != null)
        {
            if (tempBird.y > stage.stageHeight)
            {
                removeBird(i);
            }

            if (tempBird.hitTestObject(player))
            {
                gameState = STATE_END;
            }
        }
    }

    function powerUp():void
    {
        var dropType:Number = Math.floor(Math.random()*16);
        switch (dropType)
        {
            case 0:
                trace("extra coins");
                extraCoins();
                break;

            case 4:
                trace("2x coins");
                doubleCoins();
                break;

            case 2:
                trace("hyper boost");
                hyperBoostD();
                break;

            case 3:
                trace("boost");
                BoostD();
                break;

            case 4:
                trace("multiplier 1x");
                multiplierDone();
                break;

            case 5:
                trace("multiplier 2x");
                multiplierDtwo();
                break;

            case 6:
                trace("watch out!");
                watchOutD();
                break;

            case 7:
                trace("blowout");
                blowOutD();
                break;

            case 8:
                trace("plane");
                planeD();
                break;

            case 9:
                trace("haven");
                havenD();
                break;

            case 10:
                trace("bad bird");
                badBirdD();
                break;

            case 11:
                trace("trickster");
                tricksterD();
                break;

            case 12:
                trace("rampage");
                rampageD();
                break;

            case 13:

                break;

            case 14:

                break;

            case 15:

                break;

            case 16:

                break;

        }

    }

    function makeJump():void
    {
        var tempJump:MovieClip;
        tempJump = new Jump();

        tempJump.speed = playerSpeed;
        tempJump.x = Math.round(Math.random()*400);

        addChild(tempJump);
        jumps.push(tempJump);
    }

    function moveJump():void
    {
        var tempJump:MovieClip;
        for(var i:int = jumps.length-1; i>=0; i--)
        {
            tempJump = jumps[i];
            tempJump.y = tempJump.y - playerSpeed;
        }

        //test if obsticle is off-stage and set it to remove
        if (tempJump != null && tempJump.y < stage.stageHeight)
        {
            removeJump(i);
        }

        //player-obsticle colision
        if (tempJump != null && tempJump.hitTestObject(player))
        {
            jumpState = true;
            jumpStateT = 100;
        }
    }

    function stunts():void
    {
        if (jumpStateT >= 0)
        {
            jumpStateT--;
            jumpState = true;
        }
        if (jumpState = true)
        {
            Multitouch.inputMode = MultitouchInputMode.GESTURE;
            stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);
        }
    }

    function fl_SwipeHandler(event:TransformGestureEvent):void
    {
        switch(event.offsetX)
        {
            // swiped right
            case 1:
            {
                // My code
                trace ("side flip");
                score = score + 1000;
                coins = coins + 500;
                break;
            }
            // swiped left
            case -1:
            {
                // My code
                trace ("barell roll");
                score = score + 1000;
                coins = coins + 500;
                break;
            }
        }

        switch(event.offsetY)
        {
            // swiped down
            case 1:
            {
                trace ("front flip");
                score = score + 1000;
                coins = coins + 500;
                break;
            }
            // swiped up
            case -1:
            {
                trace ("side flip");
                score = score + 1000;
                coins = coins + 500;
                break;
            }
        }
    }

    function moveObsticle():void
    {
        //move enemies
        var tempObs:MovieClip;
        for(var i:int = obsticles.length-1; i>=0; i--)
        {
            tempObs = obsticles[i];
            tempObs.y = tempObs.y - playerSpeed;
        }

        //test if obsticle is off-stage and set it to remove
        if (tempObs != null && tempObs.y < stage.stageHeight)
        {
            removeObsticle(i);
        }

        //player-obsticle colision
        if (tempObs != null && tempObs.hitTestObject(player))
        {
            gameState = STATE_END;
        }
    }

/*REMOVING BS FROM STAGE*/
//remove obsticle
function removeObsticle(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(obsticles[idx]);
        obsticles.splice(idx, 1);
    }
}

function removeTer(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(terrain[idx]);
        terrain.splice(idx, 1);
    }
}

function removeSpeedBoost(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(boost[idx]);
        boost.splice(idx, 1);
    }
}

function removeCoin(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(Coins[idx]);
        Coins.splice(idx, 1);
    }
}

function removeDrop(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(drops[idx]);
        drops.splice(idx, 1);
    }
}

function removeBird(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(birdArray[idx]);
        birdArray.splice(idx, 1);
    }

function removeJump(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(jumps[idx]);
        jumps.splice(idx, 1);
    }
}

function removePPL(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(ppl[idx]);
        ppl.splice(idx, 1);
    }
}

function removeSigns(idx:int):void 
{
    if(idx >= 0)
    {
        removeChild(signs[idx]);
        signs.splice(idx, 1);
    }
}
/***.........................STATE_END....................................................................***/

    function endGame():void
    {
        gamePlay.visible = false;
        endScreen.visible = true;
    }

I have checked times and times again for any syntax missing and have failed to find a problem.

I have seen a guy asking a question here about similar error and it turns out its not eaven a syntax error, he still didnt resolve the problem.

I have also indented all the code properly and eaven used «auto format» in flash pro cs6 to see if it screams any syntax errors and it didnt.

Im making a mobile game so all the code is running in the following environment:

AIR 3,2 for android
And of course as 3.0

Thanks in advance.

Previous Animate Update introduced a few annoying glitches.  Recent update has corrected them, but now I am getting an error to an AS script file that previously ran (2 updates ago) without fail from another copied .fla. 

I am not going to insist that I dont actually have an syntax error, but I cannot find it, AND when killing the entire layer using /*, the debug posts the same errors.  (I didn’t think it read/debug/compiled anyting after /*, ?)

Does anyone know of a something that could trigger the error, or is willing to look at the script and see if I have a legit sytax error needing a right brace — I may have been looking too long, and simply am not seeing it.  According to debug there are four(?), but it does not identify line or column:

import flash.events.MouseEvent;
import flash.display.MovieClip;

//troubleshooting

accumTS_BTN.visible = false;
hydPressSwTS_BTN.visible = false;
latchCylTS_BTN.visible = false;
S101TS_BTN.visible = false;
S102TS_BTN.visible = false;
S103TS_BTN.visible = false;
S104TS_BTN.visible = false;
S105TS_BTN.visible = false;
S109TS_BTN.visible = false;
S110TS_BTN.visible = false;
SV6TS_BTN.visible = false;
SV7TS_BTN.visible = false;
SV26TS_BTN.visible = false;
SV14TS_BTN.visible = false;

TS_BTN.addEventListener(MouseEvent.CLICK, TSOn);

function TSOn(event: MouseEvent): void {
tsButton_mc.play();
troubleshoot = true;
accumTS_BTN.visible = true;
latchCylTS_BTN.visible = true;
S101TS_BTN.visible = true;
S102TS_BTN.visible = true;
S103TS_BTN.visible = true;
S104TS_BTN.visible = true;
S105TS_BTN.visible = true;
S109TS_BTN.visible = true;
S110TS_BTN.visible = true;
SV6TS_BTN.visible = true;
SV7TS_BTN.visible = true;
SV26TS_BTN.visible = true;
SV11TS_BTN.visible = true;
SV14TS_BTN.visible = true;
}

//Accumulator failure leaking will not hold reference pressure
//transducer detects leak RESP INOP Light illuminates receiver called Play hose whip mc

accumTS_BTN.addEventListener(MouseEvent.CLICK, accumFail);

function accumFail(event: MouseEvent): void {
hoseWhipFail = true;
accFails = true;
referenceFails = true;
Accum_mc.play();

if ((currentFrame == 318) || (currentFrame == 674)) {
referenceFlow_mc.gotoAndPlay(238);
accumPiston_mc.gotoAndPlay(138);
AccumLeak_mc.play();}
}

//SV6 fails to fully close leaks reference pressure leaks down RESP INOP light comes on reciever call hose whip mc

SV6TS_BTN.addEventListener(MouseEvent.CLICK, SV6Fail);

function SV6Fail(event: MouseEvent): void {
hoseWhipFail = true;
referenceFails = true;
SV6Fails = true;
SV6Fail_mc.play();

if ((currentFrame == 318) || (currentFrame == 674)) {
referenceFlow_mc.gotoAndPlay(238); 
accumPiston_mc.gotoAndPlay(137);
SV6Leaks_mc.play();}
}

//Hyd Pressure Switch failure hyd press low light stays on
//boom/drogue hyd press light does not come on

hydPressSwTS_BTN.addEventListener(MouseEvent.CLICK, hydPressSWFail);

function hydPressSWFail(event: MouseEvent): void {
hydPressSWFail_mc.play();
hydPressSWfails = true;

if (hydOn == true) {
hydPressLowLight_mc.gotoAndPlay(36);}
}

//SV7 Fails no rewind

SV7TS_BTN.addEventListener(MouseEvent.CLICK, SV7Fail);

function SV7Fail(event: MouseEvent): void {
SV7Fail_mc.play();
SV7Fails = true;
}

//SV14 Fails no hyd power to the reel

SV14TS_BTN.addEventListener(MouseEvent.CLICK, SV14Fail);

function SV14Fail(event: MouseEvent): void {
SV14Fail_mc.play();
SV14Fails = true;
accumPiston_mc.gotoAndStop(1);
HydFlow_mc.gotoAndStop(1);
latchOpenClose_mc.gotoAndStop(1);
referenceFlow_mc.gotoAndStop(1);
BoostFlowMain_mc.gotoAndStop(1);
SV6SV11_mc.gotoAndStop(1);
ServoValvePress_mc.gotoAndStop(1);
stop();
}

//SV26 Fails to close leaks hose does not stay full trail creep mc
//SV26 Fails to open Response Test inop

SV26TS_BTN.addEventListener(MouseEvent.CLICK, SV26Fail);

function SV26Fail(event: MouseEvent): void {
SV26Fail_mc.play();
SV26Fails = true;

if ((currentFrame == 318) || (currentFrame == 674) || (currentFrame == 1066)) {
gotoAndPlay(1386);}
}

//S101 failure hose stops short rewind

S101TS_BTN.addEventListener(MouseEvent.CLICK, S101Fail);

function S101Fail(event: MouseEvent): void {
S101Fails = true;
S101Fail_mc.play();
}

//S102 no SV6 no tanker ready call reciever hose whip mc

S102TS_BTN.addEventListener(MouseEvent.CLICK, S102Fail);

function S102Fail(event: MouseEvent): void {
S102Fails = true;
hoseWhipFail = true;
S102Fail_mc.play();
}

//S103 no engaged light no fuel flow in auto-response

//S104 failure no stow indication hose reel not locked comes on with power off
//at frame 1 through frame 225, then allow trail to indicate
//at 1094 play barber pole again use frames to control or AS3

// S105 Failure

//at frame 1 through frame 225 then allow trail to indicate.

//at 1094 play barber pole again use frames to control or AS3

//latch cylinder failure latch does not open trail inhibited if in motion trailing have stop at
//currentFrame if in rewind have latch ratchet mc play

//S109 failure hose does not rewind

//S110 failure response test does not stop RESP INOP light comes on
//when SW105 hit unit goes back to full trail light on

Whats the error in this thing -:

var decodeChars:Vector.<int> = new <int>[-1, -1, -1, -1, -1];

I get four complier errors three saying that «1084: Syntax error: expecting rightbrace before end of program.» and the fourth saying that «1100: Syntax error: XML does not have matching begin and end tags.».

Whats the actual problem? thanks for help

asked Jan 28, 2013 at 19:14

sanchitkhanna26's user avatar

sanchitkhanna26sanchitkhanna26

2,1238 gold badges28 silver badges42 bronze badges

1

Your code appears to be properly formed as demonstrated at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Vector.html#Vector()

1: Turn on debugging mode before compiling (Publish Settings > Flash > Permit debugging). From the errors given, It doesn’t sound like this line is the cause of the issue. Debugging mode will tell you which line is throwing errors.

2: As The_asMan already mentioned, 1084 is indicating that you have a shortage of close braces. Make sure you properly indent your code, and this issue should be apparant.

3: 1100 is indicating that an XML file you loaded is malformed. Run your XML through a syntax validator such as http://validator.w3.org/

answered Jan 28, 2013 at 19:37

Atriace's user avatar

Whats the error in this thing -:

var decodeChars:Vector.<int> = new <int>[-1, -1, -1, -1, -1];

I get four complier errors three saying that «1084: Syntax error: expecting rightbrace before end of program.» and the fourth saying that «1100: Syntax error: XML does not have matching begin and end tags.».

Whats the actual problem? thanks for help

asked Jan 28, 2013 at 19:14

sanchitkhanna26's user avatar

sanchitkhanna26sanchitkhanna26

2,1238 gold badges28 silver badges42 bronze badges

1

Your code appears to be properly formed as demonstrated at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Vector.html#Vector()

1: Turn on debugging mode before compiling (Publish Settings > Flash > Permit debugging). From the errors given, It doesn’t sound like this line is the cause of the issue. Debugging mode will tell you which line is throwing errors.

2: As The_asMan already mentioned, 1084 is indicating that you have a shortage of close braces. Make sure you properly indent your code, and this issue should be apparant.

3: 1100 is indicating that an XML file you loaded is malformed. Run your XML through a syntax validator such as http://validator.w3.org/

answered Jan 28, 2013 at 19:37

Atriace's user avatar

I am getting  the following errors at the end  the three last curly brackets when executing my swf file :-

expecting identifier before rightparen

(ii) expecting rightbrace before end of program

(iii)  expecting rightbrace before end of program

Here is my as codes :-

package  rakesh_fla

{

import flash.display.*;

import flash.events.*;

import flash.media.*;

import flash.net.*;

import flash.text.*;

import flash.ui.*;

public var default_volume:Number;

public var sound_control:MovieClip;

public var percent:Number;

public var fm_bar_bg:MovieClip;

public var music_volume:SoundTransform;

public var loader_info:TextField;

public var rakesh_background:MovieClip;

public var rakesh_fullscreen:SimpleButton;

public var total_bytes:Number;

public var loaded_bytes:Number;

public var fm_bar:MovieClip;

public var bg_music:Sound;

public var music_channel:SoundChannel;

public dynamic public class MainTimeline extends MovieClip

{

public function MainTimeline()

{

super();

addFrameScript(0, frame1, 1, frame2);

return;

}// end function

public function switch_screen_mode(event:MouseEvent)

{

if (stage.displayState == StageDisplayState.NORMAL)

{

stage.displayState = StageDisplayState.FULL_SCREEN;

}

else

{

stage.displayState = StageDisplayState.NORMAL;

}

return;

}// end function

function frame2()

{

stop();

rakesh_fullscreen.visible = true;

sound_control.visible = true;

stage.addEventListener(Event.RESIZE, resize_listener);

stage.dispatchEvent(new Event(Event.RESIZE));

rakesh_fullscreen.addEventListener(MouseEvent.CLIC  K, switch_screen_mode);

default_volume = 0.5;

bg_music = new rakesh_music();

music_channel = bg_music.play(0, 10000);

music_volume = new SoundTransform();

music_volume.volume = default_volume;

music_channel.soundTransform = music_volume;

sound_control.stop();

sound_control.addEventListener(MouseEvent.CLICK, play_pause);

return;

}// end function

public function play_pause(event:MouseEvent) : void

{

music_volume.volume = default_volume;

if (event.target.currentFrame == 1)

{

music_volume.volume = 0;

}

music_channel.soundTransform = music_volume;

event.target.play();

return;

}// end function

public function goto_music(event:MouseEvent) : void

{

navigateToURL(new URLRequest(«song»), «_blank»);

return;

}// end function

public function load_progress(event:Event) : void

{

loaded_bytes = stage.loaderInfo.bytesLoaded;

total_bytes = stage.loaderInfo.bytesTotal;

if (total_bytes == 0)

{

total_bytes = 1;

}

percent = Math.round(loaded_bytes / total_bytes * 100);

fm_bar.scaleX = percent * 0.01;

loader_info.text = «Loading… » + percent + «%»;

if (percent >= 100)

{

fm_bar.removeEventListener(Event.ENTER_FRAME, load_progress);

play();

}

return;

}// end function

function frame1()

{

stop();

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

fm_bar.addEventListener(Event.ENTER_FRAME, load_progress);

return;

function resize_listener(event:Event) : void

{

rakesh_background.x = stage.stageWidth * 0.5;

rakesh_background.y = stage.stageHeight * 0.5;

rakesh_fullscreen.x = stage.stageWidth — 22;

rakesh_fullscreen.y = stage.stageHeight — 22;

sound_control.x = stage.stageWidth — 65;

sound_control.y = 20;

return;

}// end function

}

}

}

please  help

rakesh

I am getting  the following errors at the end  the three last curly brackets when executing my swf file :-

expecting identifier before rightparen

(ii) expecting rightbrace before end of program

(iii)  expecting rightbrace before end of program

Here is my as codes :-

package  rakesh_fla

{

import flash.display.*;

import flash.events.*;

import flash.media.*;

import flash.net.*;

import flash.text.*;

import flash.ui.*;

public var default_volume:Number;

public var sound_control:MovieClip;

public var percent:Number;

public var fm_bar_bg:MovieClip;

public var music_volume:SoundTransform;

public var loader_info:TextField;

public var rakesh_background:MovieClip;

public var rakesh_fullscreen:SimpleButton;

public var total_bytes:Number;

public var loaded_bytes:Number;

public var fm_bar:MovieClip;

public var bg_music:Sound;

public var music_channel:SoundChannel;

public dynamic public class MainTimeline extends MovieClip

{

public function MainTimeline()

{

super();

addFrameScript(0, frame1, 1, frame2);

return;

}// end function

public function switch_screen_mode(event:MouseEvent)

{

if (stage.displayState == StageDisplayState.NORMAL)

{

stage.displayState = StageDisplayState.FULL_SCREEN;

}

else

{

stage.displayState = StageDisplayState.NORMAL;

}

return;

}// end function

function frame2()

{

stop();

rakesh_fullscreen.visible = true;

sound_control.visible = true;

stage.addEventListener(Event.RESIZE, resize_listener);

stage.dispatchEvent(new Event(Event.RESIZE));

rakesh_fullscreen.addEventListener(MouseEvent.CLIC  K, switch_screen_mode);

default_volume = 0.5;

bg_music = new rakesh_music();

music_channel = bg_music.play(0, 10000);

music_volume = new SoundTransform();

music_volume.volume = default_volume;

music_channel.soundTransform = music_volume;

sound_control.stop();

sound_control.addEventListener(MouseEvent.CLICK, play_pause);

return;

}// end function

public function play_pause(event:MouseEvent) : void

{

music_volume.volume = default_volume;

if (event.target.currentFrame == 1)

{

music_volume.volume = 0;

}

music_channel.soundTransform = music_volume;

event.target.play();

return;

}// end function

public function goto_music(event:MouseEvent) : void

{

navigateToURL(new URLRequest(«song»), «_blank»);

return;

}// end function

public function load_progress(event:Event) : void

{

loaded_bytes = stage.loaderInfo.bytesLoaded;

total_bytes = stage.loaderInfo.bytesTotal;

if (total_bytes == 0)

{

total_bytes = 1;

}

percent = Math.round(loaded_bytes / total_bytes * 100);

fm_bar.scaleX = percent * 0.01;

loader_info.text = «Loading… » + percent + «%»;

if (percent >= 100)

{

fm_bar.removeEventListener(Event.ENTER_FRAME, load_progress);

play();

}

return;

}// end function

function frame1()

{

stop();

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

fm_bar.addEventListener(Event.ENTER_FRAME, load_progress);

return;

function resize_listener(event:Event) : void

{

rakesh_background.x = stage.stageWidth * 0.5;

rakesh_background.y = stage.stageHeight * 0.5;

rakesh_fullscreen.x = stage.stageWidth — 22;

rakesh_fullscreen.y = stage.stageHeight — 22;

sound_control.x = stage.stageWidth — 65;

sound_control.y = 20;

return;

}// end function

}

}

}

please  help

rakesh

ActionScript Error #1084: Syntax error: expecting rightbrace before end of program.

Error 1084 is the general error number for syntax errors. ActionScript Error #1084 can be any number of errors. I will keep this one up to date with all the variations I find and how to fix them.

AS3 Error 1084: Syntax error: expecting rightbrace before end of program

This is a very easy one. This error just means that you are most likely missing a right brace. Or you have nested code improperly.

Bad Code:
[as]
package com.cjm
{
class CoolClass {
function CoolClass () {
trace(“Something cool”)
}
}
[/as]
Good Code:
[as]
package com.cjm
{
class CoolClass {
function CoolClass () {
trace(“Something cool”)
}
}
}
[/as]
Please make note of the third bracket at the end of the good code.

ActionScript Error #1084: Syntax error: expecting colon before semicolon.

You will most likely get this error if you are using a ternary statement and you forget to use a colon, forgot the last part of your ternary, or you replace the colon with a semicolon. This is illustrated in the following example:

Bad Code:
[as]
me.myType == “keys” ? trace(keys);
[/as]
or
[as]
me.myType == “keys” ? trace(keys) ; trace(defs);
[/as]
Good Code:
[as]
me.myType == “keys” ? trace(keys) : trace(defs);
[/as]
Flash/Flex Error #1084: Syntax error: expecting identifier before leftbrace.

Description:
This Flash/Flex Error is reported when you left out the name of your class. The ‘identifier’ that it is looking for is the name of your class.

Fix:
You will see in the code below that you just need to add in the name of your class and the error will go away.

Bad Code:
[as]
package com.cjm.somepackage {
public class {
}
}
[/as]
Good Code:
[as]
package com.cjm.somepackage {
public class MyClass {
}
}
[/as]
Flex/Flash Error #1084: Syntax error: expecting leftparen before colon.
or
Flex/Flash Error #1084: Syntax error: expecting rightparen before colon.

Description:
These AS3 Errors are reported when you the order of the parenthesis and colon are not in the proper place or the parenthesis is missing.

Fix:
The AS3 code below demonstrates the placement error. Properly order the items and the error will disappear. Also, make sure that a parenthesis is not missing. The ‘Bad Code’ gives an example of leftParen and then right paren in the order.

Bad Code:
[as]
public function ScrambleSpelling:void (s:String)
or
public function ScrambleSpelling(s:String:void
[/as]
Good Code:
[as]
public function ScrambleSpelling (s:String):void
[/as]
Flex/Flash Error #1084: Syntax error: expecting rightparen before semicolon.

Description:
This AS3 Error is reported most often when the parenthesis is missing.

Fix:
Make sure that a parenthesis is not missing. The ‘Bad Code’ gives an example of leftParen and then right paren in the order.

Bad Code:
[as]
tempArray.push((middle.splice(middle.length-1) * Math.random());
or
tempArray.push(middle.splice(middle.length-1) * Math.random();
[/as]
Good Code:
[as]
tempArray.push(middle.splice(middle.length-1) * Math.random());
[/as]
Flex/Flash Error #1084: Syntax error: expecting identifier before 1084.

Description:
This AS3 Error is reported when you have begun a package, class, function/method or variable with a numeric character rather than an Alpha character, _(underscore), or $(dollar sign). In the Flash Authoring environment it won’t allow you to add numerics as the first character in an instance name or in the linkage but with code it just gives this crazy error.

Fix:
Make sure to name your package, class, function/method or variable with a Alpha character, _(underscore), or $(dollar sign).

Bad Code:
[as]
package 1084_error
{
class 1084_error {
function 1084_error () {
var 1084_error:int = 123;
}
}
}
[/as]
Good Code:
[as]
package error_1084
{
class error_1084 {
function error_1084 () {
var error_1084:int = 123;
}
}
}
[/as]
P.S. It is probably not a good idea to give everything the same name as in the examples above.

1084: Syntax error: expecting rightparen before tripledot

Description:
This AS3 Error is reported when you add the ellipsis after the arguments parameter

Fix:
Make sure to add the ellipsis before the arguments parameter.

Incorrect:
[as]
public static function checkInheritance(propertyName:String, objects…) { }
[/as]
Correct:
[as]
public static function checkInheritance(propertyName:String, …objects) { }
[/as]

AS3 Error #1084 will rear it’s many heads according to the particular syntax error at the moment. I will post every variation of this error that I can find.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • 108 ошибка на котле аристон как устранить
  • 108 ошибка на аристоне