3 Replies Latest reply on Mar 15, 2007 6:58 AM by muffinboyo

    errors concerning braces that aren't actually there

    muffinboyo
      I am a student in secondary education, and for a computing project I have been developing a Flash game using Flash 8 and ActionScript 2.0.
      After implementing and testing my project with no apparent errors, I went through the code writing comments. When testing the game again, 4 errors appeared which hadn't been there before. They all concerned the positioning of the braces, and when looking at the code concerned, the braces pointed out in the error messages simply weren't there! I would be grateful if anyone could tell me why this is happening.

      Thanks in advance!
        • 1. Re: errors concerning braces that aren't actually there
          BorosAdam Level 1
          can you post the error message?

          adam
          • 2. Re: errors concerning braces that aren't actually there
            muffinboyo Level 1
            These are the 4 error messages that appeared:-

            **Error** Scene=Scene 1, layer=Background, frame=23:Line 5: Unexpected '}' encountered
            }

            **Error** Scene=Scene 1, layer=Guy, frame=78:Line 2: Statement block must be terminated by '}'
            {

            **Error** Scene=Scene 1, layer=Guy, frame=78:Line 5: Syntax error.
            }

            **Error** Scene=Scene 1, layer=Background, frame=80:Line 5: Unexpected '}' encountered
            }

            Total ActionScript Errors: 4 Reported Errors: 4

            This is the code the frames concerned:-

            Frame 23

            stop();
            { /*This adds up and displays the total score*/
            _root.hittingtotal= hitting1 + hitting2 + hitting3 + hitting4;
            _root.showhittingtotal = hittingtotal;

            }
            function gameovertomenu(){ /*This function goes the main menu if the menu button is pressed*/
            if(_root.bkmenu1.hitTest(_root._xmouse,_root._ymouse,true))
            {
            gotoAndStop(1);
            }
            }

            Frame 78

            stop();
            function gameovertomenu2() /*This function goes the main menu
            if the menu button is pressed*/

            {
            if(_root.bkmenu2.hitTest(_root._xmouse,_root._ymouse,true))
            {
            gotoAndStop(1);
            }
            }

            Frame 80

            stop();
            { /*This adds up and displays the
            total score*/
            _root.hittingtotal= hitting1 + hitting2 + hitting3 + hitting4 + 100;
            _root.showhittingtotal = hittingtotal;
            }
            function gameovertomenu4(){ /*This function goes the main menu if the menu button is pressed*/
            if(_root.bkmenu4.hitTest(_root._xmouse,_root._ymouse,true))
            {
            gotoAndStop(1);
            }
            }

            Thanks a lot!
            • 3. Re: errors concerning braces that aren't actually there
              muffinboyo Level 1
              I have just discovered that even if all the code is removed from the above frames the same error messages are still displayed...