1 Reply Latest reply on Mar 25, 2009 6:44 AM by SylKen77

    canvas.visible = true does'nt always make the canvas visible

    SylKen77 Level 1
      I'm trying to make the following thing work:
      2 buttons and hidden canvas.

      What I expect:
      MouseOver button --> canvas fades in
      MouseOut button --> canvas fades out
      this aint a problem, but then:
      MouseOver button1 --> canvas fades in
      Quickly mouseover button2 --> canvas fades out and then fades in again

      What happens:
      MouseOver button1 --> canvas fades in
      Quickly mouseOver button2 --> canvas fades out but fails to fade in

      A second hidden canvas that has no showEffect or hideEffect displays correctly in either case.

      Who can fix the example code I have supplied to achieve the wanted effect?
        • 1. Re: canvas.visible = true does'nt always make the canvas visible
          SylKen77 Level 1
          Ok, solution found :-)

          I was already thinking about this beeing a threading/timing issue but I did'nt know about the callLater method.

          replace the fadeEnd method in the code above by these two methods and voilla... works as intended.

          private function fadeEnd(event:EffectEvent):void {
          if (doShow) {
          callLater(showPopups);
          }
          }

          private function showPopups():void {
          popup.visible = true;
          popup2.visible = true;
          }