2 Replies Latest reply on Sep 27, 2012 8:54 AM by Magnolia grandpa

    looping result

    Magnolia grandpa

      This is in my movie script:

       

      on noteintProb

       

        _global.issueList.add(systemDate().month)

       

         

      end

       

      This is all I have in the related area:

       

      on enterFrame me

       

        noteintProb

       

      end


      I get the desired "9." But I get several hundred of them. What is causing the loop?

        • 1. Re: looping result
          James Newton, ACP Level 3

          What is causing the loop?

          Director.

           

          If you click on the blue margin to the left of the line...

           

          noteIntProb

           

          ... you will see a red dot appear. This is a breakpoint. When you run your movie, each time the on enterFrame() handler is called, the Debugger window will open at this point. Click on the Close button to close the window. It will reopen immediately. Director has called the on enterFrame() handler again.

           

          That's what Director does. Every time it updates the screen (which it does many times a second), it sends an #enterFrame event to all sprites, to say "I've finished updating the screen. I'll let you do some stuff now. When you've finished, I'll wait a bit until it's time to update the screen again."

           

          Perhaps it would make more sense to change on enterFrame to on beginSprite. That will only get called once, when the playback head arrives on a frame where the sprite exists from a frame where it did not exist.

          • 2. Re: looping result
            Magnolia grandpa Level 1

            Thanks for the thorough explanation.

             

            MagnoliaGPa