3 Replies Latest reply on Apr 15, 2007 7:11 AM by Greg Dove

    Receiving ERROR Messages

    WebXperience Level 1
      In testing my movie, I am receiving the following error messages:

      ======================================
      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler
      var cycle:Number = 0;

      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: Statement must appear within on/onClipEvent handler
      update();

      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Statement must appear within on/onClipEvent handler
      onEnterFrame = update;

      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Statement must appear within on/onClipEvent handler
      function update()

      Total ActionScript Errors: 4 Reported Errors: 4
      ==============================================

      Here is the code:

        • 1. Re: Receiving ERROR Messages
          Greg Dove Level 4
          I think you have your code attached to an movieclip or component directly.

          Try select all, Cut. Then select the frame you want to have it in, and paste back into the actionscript window.
          • 2. Receiving ERROR Messages
            WebXperience Level 1
            The code is on its own action layer at Frame #1 of the root timeline.
            I had accidently placed in on the same layer as the movieclip that is being manipulated. But I cut and pasted it onto its on layer in the root timeline.

            Thanks GWD!
            • 3. Re: Receiving ERROR Messages
              Greg Dove Level 4
              You're welcome. FYI I think that even though the clip you had was on its own layer originally, the code was attached to the clip directly and not to the frame the clip was in. If you select a clip and then paste into the actionscript window you'll see what I mean - no 'a' will appear in the frame telling you it now has actionscript in it.

              By placing the code on a separate empty layer you ensured you did not have the clip selected first and achieved what needed to be done. But the same result could have been achieved by clicking on the frame in the timeline before pasting, even on the same layer that the clip was in. (If all that makes sense)

              I've done the same thing before by accident too. More than once I think. Easy enough to do when you're flicking between frame actions and editing author-time properties of individual movieclips. Can be frustrating because you end up looking in all the wrong places for the problem.