4 Replies Latest reply on Nov 27, 2006 12:12 PM by jordana309

    mouse listener + if statement

    jordana309 Level 1
      Greetings!

      I have some bizzarness happening. I have a component that my team built that I wanted to make able to emulate the Active/Inactive window thing that Windows does (since our components will be on a primarily Windows-based world). To do this, I put a mouse listener on one of the movieClip objects that make up this component. The code works, and it runs just fine. Except something wierd is happening...Here's my code (on bottom):

      By way of expanation, _instructionsPane is the movieClip object's variable name, isHidden is a boolean to know if the instructions Pane has been collapsed (as you can collapse the content into the title bar). The stuff with the this._xmouse and this._ymouse are the dimentions of the box, so that if you click anywhere inside of the box, it's active. Anywhere outside, it's made inactive. focusInstructions will simply move the play head inside of the _instructionsPane movie to a frame to show status: darker for active, lighter for inactive, and it does the same with the collapse button, so it matches.

      Anyway, the wierd thing: it seemed to be making the calls oddly. I put in these numeric traces, and here's what was traced when isHidden == false:
      2
      1
      2
      Why is trace("2") called first, then the onMouseDown function, then the trace("2") again? That makes no sence to me. I would expect to see this as my output:
      1
      2
      So where's the extra 2 comming from?

      Thanks!

      Currious,
      JA