0 Replies Latest reply on Feb 24, 2009 9:47 PM by jbucaran

    updateAfterEvent or invalidateDisplayList

    jbucaran
      From the source of the Button.as class.

      if (phase == ButtonPhase.OVER)
      {
      phase = ButtonPhase.UP;

      // Force a "render" event, which will cause updateDisplayList()
      // to show the appropriate skin for the new phase.
      event.updateAfterEvent();
      }

      That is executed inside event handlers for mouse events. The difference is the state that is set depending if it's roll over, roll out, and so on. Please note that phase is a property set/get pair that actually calls invalidateDisplayList

      My questions are

      1. Why do you need to call updateAfterEvent if updateDisplayList is already being called?

      2. If updateAfterEvent forces rendering of the frame (which involves calling updateDisplayList right?) why do you need to call invalidateDisplayList yourself when changing the phase? Wouldn't updateAfterEvent just do it?

      3. What is the difference between invalidateDisplayList and updateAfterEvent?

      Thanks.