2 Replies Latest reply on Apr 20, 2014 11:16 PM by SunLight

    Weird doubles in "on enterFrame"

    SunLight Level 1

      I have striped my projects in order to nail down a problem to the bare 1 movie script with:

       

      on enterFrame

        put _movie.frame

      end enterFrame

       

      And for some weird reason, I consistently get doubles like this in the Msg window:

       

      -- 1

      -- 1

      -- 2

      -- 2

      -- 3

      -- 3

      -- 4

      -- 4

       

      I tried doing a new movie from scratch just to check, but it seems fine. Why would that

      happen in my old movie? I checked tempo, doesn't change anything, removed xtras,

      double checked some preferences that might influence but nothing.

       

      If you have had this problem before and found out the source let me know,

       

      Thank you

       

      I have this with Trace on:

       

      == Frame: 1

      --> put _movie.frame

      -- 1

      --> end enterFrame

      --> put _movie.frame

      -- 1

      --> end enterFrame

      == Frame: 2

      --> put _movie.frame

      -- 2

      --> end enterFrame

      --> put _movie.frame

      -- 2

      --> end enterFrame

      == Frame: 3

      --> put _movie.frame

      -- 3

      --> end enterFrame

      --> put _movie.frame

      -- 3

      --> end enterFrame

       

      What on earth causes this?

       

      Message was edited by: SunLight

        • 1. Re: Weird doubles in "on enterFrame"
          James Newton, ACP Level 3

          Try changing your handler to this:

           

          on enterFrame me

            put _movie.frame, me

          end enterFrame

           

          I am guessing that you created a behavior and attached it to a sprite, and then you later changed that behavior to a movie script.

           

          If I am right, then you might see something like:

           

          -- 1 <offspring "" 4 532f770>

          -- 1 <Void>

          -- 2 <offspring "" 4 532f770>

          -- 2 <Void>

           

          The sprite receives the #enterFrame event and prints out the frame number plus its value of "me", then the same script receives the #enterFrame event as a movie event, but this time the value of "me" is VOID.

           

          However, this interpretation depends on you have at least one sprite in your barebones movie, in addition to your movie script.

           

          Another possible suspect might be a timeOut object, which can send additional movie events to behaviors, but that does not fit the description that you have given.

          • 2. Re: Weird doubles in "on enterFrame"
            SunLight Level 1

            Hi, thanks for your reply,

             

            I tried your suggestion but get an

            Script error: Variable used before assigned a value

            put _movie.frame, me?

             

            But you must be right about something going on in the meta info about the script, since that

            gave me the idea of creating a new empty movie script in the same project and copying everything

            from the old one verbatim and the problem is gone.

             

            Stranger things have happened

             

            Thanks