2 Replies Latest reply on Feb 12, 2009 8:37 AM by Newsgroup_User

    syntax error 1084

      While attempting to go through some simple exercises to learn action script I ran into a problem with this code. can anyone tell me why I am getting syntax error 1084. The instance name is star in the property inspector and it is a movie clip.


      star.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
      star.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);

      star.buttonMode = true;

      function mouseDownHandler(evt:Object):void { (here is where the error directs me)
      star.startDrag();
      star.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);

      }

      function mouseUpHandler(evt:Object):void {
      star.stopDrag();
      star.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
      }

      function mouseMoveHandler(evt:Object):void {
      if (star.x > moon.x) {
      star.alpha = 0.4;
      } else {
      star.alpha = 1;
      }
      {
      Text Text
        • 1. Re: syntax error 1084
          Level 7
          ampslinger,

          > While attempting to go through some simple exercises to learn
          > action script I ran into a problem with this code. can anyone
          > tell me why I am getting syntax error 1084.

          This looks like one of the examples in Foundation Flash CS3 (or CS4) for
          Designers, which I co-wrote, so I should definitely be able to help you
          here! :) When I check the completed sample FLA in Flash CS4, the SWF
          compiles without errors, and the code you posted looks fine, off the top of
          my head.

          Which version of Flash are you using, by chance?


          David Stiller
          Co-author, ActionScript 3.0 Quick Reference Guide
          http://tinyurl.com/2s28a5
          "Luck is the residue of good design."


          • 2. Re: syntax error 1084
            Raymond Basque Level 4
            Looks like you're closing mouseMoveHandler with an opening brace. Turn it around and you should be ok.