Oh man, thank you for this example!

This totally blows me away. I am sorry I was so persistent. You are correct.
I will have to check all my applications now, hehe.

This also means that all my earlier arguments are incorrect and that the use
of Delegate is indeed very dangerous.

Thank you for showing this to me! To me this really is unexpected
behaviour... I just can not believe that this is designed behaviour...



Greetz Erik



On 3/13/08, Cory Petosky <[EMAIL PROTECTED]> wrote:
>
> > There is no such thing as "a reference to be created invisibly within
> the event system".
>
>
> I disagree. Try this test code:
>
> package {
>         import flash.events.Event;
>         import flash.display.Sprite;
>         import flash.utils.getTimer;
>
>         public class TestClass extends Sprite {
>                 public function TestClass() {
>                         trace("Started!");
>                         var s:Sprite = new Sprite();
>                         s.addEventListener(Event.ENTER_FRAME, listener);
>                         addEventListener(Event.ENTER_FRAME, listener);
>                 }
>
>                 private function listener(event:Event):void {
>                         trace(event.currentTarget.toString() +
> getTimer());
>                 }
>         }
> }
>
> You'll see both event handlers fire until the end of time.  Event
> references actually are kept, invisibly, within the event system.
>
>
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to