1 Reply Latest reply on Apr 23, 2007 1:03 PM by Xx)MaveriK[X]

    Reference problem

    Xx)MaveriK[X]
      Hello there.

      I created an instance of FLVPlayback on my stage. When I press a button, I assign a "complete" event to the video.
      I delegated the function to my class scope, so I can use the correct 'this' inside the event function.
      But now I want to remove the listener when it occurs:

      // Class constructor snip
      this.button.onRelease = Delegate.create( this, this.onReleaseEvent );
      this.onComplete = Delegate.create( this, this.onCompleteEvent );

      // onReleaseEvent function
      function onReleaseEvent() {
      this.video.addEventListener("complete", this.onComplete);
      }

      // onCompleteEvent funcion
      function onCompleteEvent( obj:Object ) {
      this.video.removeEventListener("complete", this.onComplete);
      }

      But the event is not removed...
      Any tips on how to remove it?

      Thanks,
      Ian Liu.