Analog of Watch() in AS3
Hello everyone!
Here is a situation:
var MAIN_OBJ:Object = new Object();
MAIN_OBJ.array_1 = new Array(1, 2, 3);
MAIN_OBJ.array_2 = new Array(A, B, C, D, E, [f,g,h,i,j]);
MAIN_OBJ.array_3 = new Array([k,l,m,n,o,p], Q, R, S, T);
ActionScript2:
function someFunction(prop, oldVal, newVal, limit) { trace("prop is about to change"); return newVal;}
MAIN_OBJ.watch("array_1", someFunction);
ActionScript3:
Use accessor properties (get/set functions) or the flash.utils.Proxy class for similar functionality.
Here is the task:
Watch some property of object to change, and do smth. Watch not the whole object, only one property.
I know that ExternalInterface.addCallback provides smth like that, but for the whole object.
I've never used get/set functions or override smth, please explain what should exactly be written to achieve the same effect as in AS2. The simplier it would be - the better.
Sorry fo my English.
