3 Replies Latest reply on Jul 24, 2009 8:05 AM by jeffreypritchard

    ChangeWatcher not firing - all of a sudden

    jeffreypritchard

      I've been working on a project for about a month and suddenly my ChangeWatcher.watch handler is no longer firing. I'm simply watching a boolean and when it changes, the calling a method. I haven't touched any of that code for weeks, and now it does not work ? Has anyone seen this ? I'm not sure what happened, except to say that the binding is definitely broken.

       

      I can understand if I had changed something in the code, but i didn't. I am completely at a loss. Does anyone have an alternative method to watch an object's properties and call a handler. The class is an actionscript class (not an MXML file) which extends UIComponent.

       

      Any help would be appreciated greatly.

        • 1. Re: ChangeWatcher not firing - all of a sudden
          Flex harUI Adobe Employee

          Step through the changes to the Boolean and make sure it is firing an event.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: ChangeWatcher not firing - all of a sudden
            jeffreypritchard Level 1

            Hi Alex,

             

            I've done that (stepped through) and the Boolean value being watched by the ChangeWatcher is definitely changing, but how can I tell if it is firing an event ? I don't understand what you mean. I appreciate your time. The problem I'm having is that I am watching the property, and when it changes value, I call a handler method. The reason the handler is not being called is because the event never fires (PropertyChangeEvent).

             

            I appreciate your time.

            • 3. Re: ChangeWatcher not firing - all of a sudden
              jeffreypritchard Level 1

              I can see that the PropertyChangeEvent is created and populated correctly (by stepping in to the setter for the property), but it doesn't fire as much as I can tell (I don't see where it fires). How would I go about checking to see if it is dispatched ?

               

              Is there a problem watching two different properties in the same object ? I doubt it only because this code was all working fine. At this point I'm completely at a loss, but others seem to be having the same issue (without resolution).

               

              Here'e the code for the ChangeWatchers:

               

              if (ChangeWatcher.canWatch(this.sectorData.Status.SelectedStatus,"isSelected")){
                   selectedWatcher = ChangeWatcher.watch(this.sectorData.Status.SelectedStatus, "isSelected", selectedHandler);
              }
              
              if (ChangeWatcher.canWatch(this.sectorData.Status.BroadcastStatus,"isBroadcasting")){     
                   broadcastWatcher = ChangeWatcher.watch(this.sectorData.Status.BroadcastStatus,"isBroadcasting", broadcastUpdateHandler);
              }
              

               

              For the record, the first one works fine ('selectedWatcher'), but the second one does not. Any input is appreciated. I've also placed the chain argument into an array as some of the documentation suggests, with the same result.