3 Replies Latest reply on May 7, 2008 11:11 PM by Newsgroup_User

    Weird frame error - only in Projector

    Level 7
      Okay, this one makes no sense at all. I found a bug that causes the
      projector to advance 1 frame, causing a large number of scripts to fail,
      because they're checking for the frameLabel. The weird part is the bug
      occurs ONLY in Projector mode, and not Authoring. What I can't figure out
      is why the frame is changing in the first place - there's no code anywhere
      telling it to do that. All frame-related code either says "go the frame" or
      it says to go to a specific marker, never "go the frame + 1" or "go next" or
      anything like that. The other weird thing is it always seems to be
      triggered by a right-click of the mouse. Anybody ever see anything like
      this before?


        • 1. Re: Weird frame error - only in Projector
          Level 7
          Okay, after a bit of error-checking, I've discovered that this is caused by
          the frame script NOT running sometimes, just for one frame. Thus, my script
          saying:

          on exitFrame
          go the frame
          end

          is simply not happening for one frame, and the movie naturally advances to
          the next frame. (The frame scripts are all stretched out to at least 5
          frames, so the movie then holds on that next frame.) Now, WHY this script
          is not occurring when the right mouse button is clicked utterly baffles me.
          I've made a quick and ugly patch for the problem with the following code:

          if the frame mod 5 > 0 and the frame > 1 then go the frame - (the frame mod
          5)

          This makes sure the frame always stays on a multiple of 5 (or frame 1, since
          there isn't a frame 0), and even if it advances 1 frame for unknown reasons,
          it will automatically jump back to the most recent multiple of 5. Since all
          my markers are set at multiples of 5, this corrects the problem, but it
          doesn't explain why the problem occurs in the first place. Also, this is
          only a partial solution, as the movie will still be sitting on the wrong
          frame for 1 frame - so far this doesn't cause any errors, but there's always
          the possibility that a complication could occur. Moreover, I don't think I
          should HAVE to fix the problem this way, the "go the frame" script by all
          rights SHOULD execute every frame, but for whatever reason it doesn't, and
          I'm forced to accomodate. Anybody have a clue what could be causing this?


          • 2. Weird frame error - only in Projector
            stephen_ Level 1
            What is the right-click doing and what are you clicking on? Does it occur in other frames? Does it occur when you click anywhere on the stage or only when you click on a particular sprite?


            • 3. Re: Weird frame error - only in Projector
              Level 7
              > What is the right-click doing and what are you clicking on?

              That's the weird part - it doesn't seem to matter. Pretty much any sprite
              with an "on rightMouseDown" or "on rightMouseUp" handler is causing the bug.
              Some of them are moveableSprites, (which is really annoying because I want
              them to be moveable only with the left button, not the right - there doesn't
              seem to be an option for that, so I have to reset them to their default
              location whenever the RMB is pressed.) Some cause context-sensitive menus
              to appear. But one thing that not one of them does is anything involving
              the frame. In many cases, the RMB is used to remove an object from a list
              or property list somewhere in the program. (It's a standard UI element
              throughout the program - here's a list of the things you have here,
              right-click to remove an item from this list, left click to activate it,
              move it, etc.) It would be very hard to give you an example of the script
              that's occuring, because it happens in so many different locations, but
              always, it involves the RMB, and it always is characterized by
              inappropriately advancing to the next frame. I don't have a global
              "rightMouseDownScript" or anything else like that going on anywhere. And I
              can't find a single instance in all my code where I tell the movie to
              advance the frame by one. It either goes to a marker, or holds on the
              current frame. (I did a full search for the word "go" or "frame" and
              checked out every single instance.)

              The only thing I think could be causing this is if the movie were somehow
              ignoring the frame script for just one frame. Like you know how when you
              have a Shockwave/Flash movie in a browser and you right-click and get that
              menu that shows you a few default options, etc.? Something like that, that
              interrupts any of your written code, only it's not Shockwave, it's a
              projector, and no menu appears, but it does seem like Director is somehow
              intercepting my right-clicks and briefly ignoring the frame script when it
              happens. And the fact that it doesn't happen at all in Authoring mode makes
              this devilishly difficult to debug. I was only able to determine the
              primary symptom (not being on the right frame) by using the
              debugPlaybackEnabled property to get a Message Window in the projector. All
              the other varied bugs that were occurring happened because it wasn't on the
              right frame. When I used the Message Window to put it back on the frame,
              everything functioned normally again, which is how I came up with the patch
              solution I mentioned before. But it still seems like something that I
              really shouldn't have to do. It drives me nuts that I can't figure out
              what's causing this in the first place.