In the comments of my previous post about how the garbage collector works in Flash Player 9, Cédric Néhémie asked a great question about why using delete on a property of a sealed (non-dynamic) class throws an error in ActionScript 3, and whether it will delete the actual object in memory.

There isn't a lot of documentation on this topic, and what there is is hard to find, so much the following is conjecture and interpolation from related exploration, but I think it is fairly accurate. If not, please let me know in the comments - I don't want to lead anyone astray.

My understanding is that the delete keyword deletes the actual variable definition, not just the variable's value. This of course frees any reference it was holding, potentially freeing that object for garbage collection (as described in my previous article). It will not delete the referenced object from memory directly.

ActionScript 2
In AS2, this behaviour was virtually unnoticeable, as the player did not have support for sealed (non-dynamic) classes at run-time. This meant that deleting a variable definition was functionally almost identical to setting the variable's value to undefined. Because of this, the compiler never bothered throwing errors related to delete. There were only a few rare cases where differences could be seen. For example, in AS2 try deleting a MovieClip instance's onPress handler and mousing over the clip. Now try setting its onPress to undefined. Even though tracing onPress will return "undefined" in either case, you will get a hand cursor on the one you set to undefined but not on the one you deleted. I'm quite sure this is because the player looks for the existence of the onPress handler definition, not a value, when determining if it should show the hand cursor.

ActionScript 3
AS3 on the other hand supports sealed classes at run-time. All classes are sealed by default, unless they are explicitly declared to be dynamic. You may not modify the definition of a sealed class (or its instances) by adding or removing members at run-time. Because of this, and to comply with the ECMAScript specification, delete will only remove dynamically created properties of dynamic classes. It will not even remove local (method level) variables. This is alluded to in the "What's new for the PrintJob class using ActionScript 3.0" doc (for whatever reason):

In ActionScript 2.0, you could use delete to remove an object or on an object property. In ActionScript 3.0, the delete operator is now ECMAScript compatible, meaning delete can only be used on a dynamic property of an object.

If you try to use delete on anything other than a dynamic property, it will trigger a compiler error (in strict mode) that looks something like this:

1189 > Delete removes dynamically defined properties from an object. Declared properties of a class can not be deleted. This error appears only when the compiler is running in strict mode.

In AS3, delete will return a boolean value indicating whether it was successful (ie. the property no longer exists when the operation completes). You can test this with the following code:

var t:* = new Timer(15); // no typing to get around the compiler error
trace(delete(t.delay)); // traces false, object is sealed so can't delete
trace(t.delay); // 15 - delete never occurred

var o:* = {fun:"stuff"};
trace(delete(o.fun)); // traces true, object is dynamic so can delete
trace(o.fun); // undefined - delete occurred
trace(delete(o.foo)); // true, because foo is not defined after delete

UPDATE: Added information to the article about delete returning a boolean success value.
UPDATE 2: Rewrote some sections slightly based on new information found in the AS3 docs.