On occasion watching for the change of state in an object can be tricky. A whole series of variables come into play when doing this. One very slick way to monitor and get updates about the change in state of an object is to use the Changewatcher class. By definition "* The ChangeWatcher class defines utility methods that you can use with bindable Flex properties. These methods let you define an event handler that is executed whenever a bindable property is updated."(Adobe Actionscript 3.0 documentation). The method in question is the watch() method, it watches for changes in a [Bindable] variable or method and fires an event when there is a change. This is of great use when the change is random and the time of change indeterminate. To use it you
1. import mx.binding.utils and set a [Bindable property]
public var __getcurrentstate:String;
2. set up the ChangeWatcher.watch method
ChangeWatcher.watch(this, '__getcurrentstate', watchcurrentstate);
3 set up the event listener method, in this case the watchcurrentstate method
public function watchcurrentstate(e:Event):void
Logger.info('Watched::::::::::::: ', __getcurrentstate);
Now if the __getcurrentstate value gets changed. you will be notified by watchcurrentstate.
Artist, Creative Technologist, Mobile Developer, Maker of beautiful things, a Renaissance Man
This is what is needed to remove Nautilus Dropbox from Ubuntu. sudo apt-get remove nautilus-dropbox rm -rf ~/.dropbox rm -rf ~/.dropbox...
Every so often an adage becomes part of your experience. The one for the day was "a friend in need is a friend indeed". I was trul...
This occurred after I had finally set up Google Glass to sync with ADB DDMS] device unauthorized. Please check the confirmation dialog on yo...
Powered by Blogger.
I've always been majorly turned on by augmented reality since my first forays into it as an ActionScript developer. The idea of digita...