After all of Adobe's crowing about how much better SWF8 is, do you mean they
actually broke closures, making it incompatible with the ECMAScript
standard? Or did closures never really work in the first place? Haven't
closures been fixed in Flash 8? Could the Laszlo compiler simulate them?
The thing about JavaScript never closing over "this" is totally annoying,
because that's exactly the variable you want to close over a lot of the
time. But I think that's an official wart on the JavaScript specification...
-Don
http://jibbering.com/faq/faq_notes/closures.html
Rigorous definition of ECMAScript closures.
http://www.openlaszlo.org/pipermail/laszlo-dev/2005-February/000712.html
[somebody asking about closures on the Laszlo mailing list a while ago]
http://labs.adobe.com/wiki/index.php/As
Adobe documentation that implies closures were broken in AS2 but work in AS3
(now I'm really confused!):
Delegation
Event handling is simplified in ActionScript 3 thanks to its built-in
delegation. In ActionScript 2, method closures would not remember what
object instance they were extracted from, leading to unexpected behavior
when the method closure was invoked. The mx.utils.Delegate class was a
popular workaround; to use it, you would write code as follows:
myButton.addEventListener("click", Delegate.create(this, someMethod));
Delegate.create(this, someMethod)
This class is no longer needed, since a method closure will now
automatically remember its original object instance. Now, one can simply
write: myButton.addEventListener("click", someMethod);
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev