3 Replies Latest reply on Jan 15, 2009 6:12 AM by Newsgroup_User

    callLater order

    Richard_Abbott Level 3
      Hi all,
      I tend to use callLater quite a lot, usually to ensure that something has finished happening after initialising some component or other from a downloaded XML config file. Now, does callLater in any way guarantee an order of execution? I find I'm running the risk of setting off two "chains" of handlers and started to wonder if I could be sure what would happen first.
      Thanks, Richard
        • 1. Re: callLater order
          Level 7

          "Richard_Abbott" <webforumsuser@macromedia.com> wrote in message
          news:gkkaqb$5ge$1@forums.macromedia.com...
          > Hi all,
          > I tend to use callLater quite a lot, usually to ensure that something has
          > finished happening after initialising some component or other from a
          > downloaded
          > XML config file. Now, does callLater in any way guarantee an order of
          > execution? I find I'm running the risk of setting off two "chains" of
          > handlers
          > and started to wonder if I could be sure what would happen first.

          No.

          You should be using the invalidation functions. If you call

          invalidateProperties();
          invalidateSize();
          invalidateDisplayList();

          The functions will run this way:

          commitProperties();
          measure();
          updateDisplayList();

          If you call them like this:

          invalidateSize();
          invalidateProperties();
          invalidateDisplayList();

          They will still run like this:

          commitProperties();
          measure();
          updateDisplayList();

          And if you call them like this:

          invalidateDisplayList();
          invalidateSize();
          invalidateProperties();

          They will still run like this:

          commitProperties();
          measure();
          updateDisplayList();

          That means that you can put calls in to these whenever you do something that
          means that you need to run code that you've put into your override of one of
          these functions, and you can be guaranteed that at the next invalidation
          cycle that the code will run in that order.

          HTH;

          Amy


          • 2. Re: callLater order
            Richard_Abbott Level 3
            Thanks Amy
            • 3. Re: callLater order
              Level 7

              "Richard_Abbott" <webforumsuser@macromedia.com> wrote in message
              news:gkmres$ik4$1@forums.macromedia.com...
              > Thanks Amy

              You're welcome. :-)