ActionScript: this, _parent and _this.parent

It seems that ActionScript has a very interesting, yet unusual way, of defining scopes. Take a look at the following source code:

    m.onRollOver = function() {
	trace("this: " + this);
        trace("this._parent: " + this._parent);
        trace("_parent: " + _parent);
    }

The first trace will show the path to the current object, in this case m; the second will print the path to m's parent. But the last trace will print undefined - or something else, depending on where the event handler is nested. In other words, inside an event handler, only the instance variable this is binded, everything else remains relative to the scope where the event is defined. Because this doesn't follow the common patterns found in most programming languages, it can be a perfect source for pitfalls.

Conclusion: In most cases, inside an event handler this._parent referrers to the desired parent (and not _parent).