2 Replies Latest reply on Jun 21, 2011 1:28 PM by sinious

    Finding a pesky movieclip that's stealing clicks

    sinious Most Valuable Participant

      Hey all,


      I have a fairly complex form page and there's one MovieClip that's misbehaving. It's quite a bit of code so I'm having trouble locating where it's being generated from because the page is fairly dynamic.


      I'm looking for a sort of MovieClip.prototype-esque way of trace()ing the name of any clip that's clicked in a global fashion. Thus when I click and the misbehaving movieclip is firing off I can figure out who/what it is.


      I find that when I override the prototype of any part of MovieClip that it renders other elements unusable. For example I tried to just override onReleaseOutside temporarily to see if I could get the clips name but it also disabled onPress, onRelease, etc and everything stopped working.



      MovieClip.prototype.onReleaseOutside = function() { trace('onReleaseOutside: ' + this); }


      It dutifully tells me the name of the clip that onReleaseOutside is triggered by but no more regular onPress or onRelease events work after I do that, globally.


      Any other strategy suggestions to locate this rogue MovieClip?



        • 1. Re: Finding a pesky movieclip that's stealing clicks
          Ned Murphy Adobe Community Professional & MVP

          I'm not really clear on the issue with findoing a fogue object, but mAybe you could do something along the lines of setting this._alpha = 50;  until you isolate which one it is.

          1 person found this helpful
          • 2. Re: Finding a pesky movieclip that's stealing clicks
            sinious Most Valuable Participant

            I know what you mean but we're talking thousands of lines of code.. Any simple way to add a global mouse listener similar to a trapallkeys way of globally monitoring mouse clicks the way you can monitor keys? I just want to print the path of every clip that's ever clicked.


            Any simple way to globally set a listener up so it prints the name of every single movieclip ever clicked?


            Note: I would typically agree with your solution but I have several hidden hit areas that serve the purpose of blocking out clicks where I don't want them. e.g. a Modal. This is the case. I have invisible hit movieclips in places that should trigger a close of an on-screen keyboard. However anywhere I click (even not on these clips) the keyboard is being disabled. This just means somewhere inside this mass of code there's another clip that's disabling my keyboard prematurely. I'm trying to locate it..




            Figured it out.. It's always something.. Hidden below all the debris was a onKillFocus function still on the input text that was firing off. In FP9 or FP10 this worked differently than in FP8. In FP8 it happened before everything else, causing the odd behavior.


            Thanks anyhow!