3 Replies Latest reply on Jan 15, 2009 8:10 AM by rtalton

    Displaying container on Rollover

    tgoodmannz_bss Level 1
      Hi,

      I have the following setup:
      Container A
      - On Rollover display (smaller) Container B overlaid on Container A
      - On Rollout hide Container B

      Problem is, if I rollover Container A, then rollover Container B, it thinks that I have rolled out of Container A. This creates a "flashing" effect of Container B...

      Is there a simple way to stop this? I only want the mouse events from Container A to effect Container B's visibility...

      Thanks



        • 1. Re: Displaying container on Rollover
          Madhav Subedi Level 4
          well, i think i got whats happening.
          use a flag to hold whether the mouse is over B or not
          on b_rollover, mouse_on_b = true;
          on b_rolloout, mouse_on_b = false;
          on a_roll_out, if(!mouse_over_b) b.visible=false;
          hope it works.
          • 2. Re: Displaying container on Rollover
            Level 7

            "tgoodmannz_bss" <webforumsuser@macromedia.com> wrote in message
            news:gkmq89$h53$1@forums.macromedia.com...
            > Hi,
            >
            > I have the following setup:
            > Container A
            > - On Rollover display (smaller) Container B overlaid on Container
            > A
            > - On Rollout hide Container B
            >
            > Problem is, if I rollover Container A, then rollover Container B, it
            > thinks
            > that I have rolled out of Container A. This creates a "flashing" effect
            > of
            > Container B...
            >
            > Is there a simple way to stop this? I only want the mouse events from
            > Container A to effect Container B's visibility...

            Try setting mouseEvents to false on B

            HTH;

            Amy


            • 3. Re: Displaying container on Rollover
              rtalton Level 4
              As you've discovered, you have created a feedback loop in container A by using both the rollOver and rollOut events. This is all Flex can do, and is perfectly logical.
              One quick solution is to only use the rollOver event on container A, like this:
              panelB.visible = !panelB.visible;
              This works if B is completely surrounded by A , but the user will still have to move completely off A and then back onto it to show B again. Best you can do, I think.

              BUT if B extends beyond A's boundaries, than A will not get a rollOut event when you rollOut of B in a certain direction. So the user may get confused.

              There are other gotchas; you need to just try this in your particular case and then deal with the law of unforseen consequences.