I know 'this' differs outside and inside of the closure.
But why numChildren and this.numChildren differs inside the closure?
Or why numChildren is same outside and inside?
var _this:Sprite = this;
trace("[outside]this: " + this);
trace("[outside]numChildren: " + numChildren);
trace("[outside]this.numChildren: " + this.numChildren);
(function ():void {
trace("[inside]this: " + this);
trace("[inside]numChildren: " + numChildren);
trace("[inside]this.numChildren: " + this.numChildren);
trace(_this.removeChildAt === removeChildAt);
trace(this.removeChildAt === removeChildAt);
})();
You can see the code and the output from the following link
How Do You Explain 'this'?