watch() function in flash explained: mouse detection tutorial

I was trying to find code to give answer to actionscript question on flashkit board when I came across this page: Detecting Direction of Mouse Movement on kirupa.com.

At first, I dismissed this as one of the things that I already know, but after reading the thread where the solution came from, I noticed the watch() function. That was the first time I heard of this function.

It’s actually a neat function to make flash, yup you guess it, watch a variable. If that variable changes, it will call a function provided as one of its arguments (the other one is the variable to watch).


Got something to say?