null object reference in ScrollPane/endDrag() when scrollDrag=true

Posted by SP on Stack Overflow See other posts from Stack Overflow or by SP
Published on 2010-03-09T23:15:16Z Indexed on 2010/03/20 4:11 UTC
Read the original article Hit count: 387

Filed under:
|
|

Hello there.

In my flash application, I've got multiple windows which use Scrollpanes. The scrollDrag property is set to true on these because I want that functionality. If I close (within my application) one of these 'windows' and open another, I seem to get a whole lot of this error showing up in my logs:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::ScrollPane/endDrag()

Sometimes I get thousands of these, which I'm guessing is probably slowing my app down a bit, but otherwise is not causing a problem. Looking through the adobe code for scrollpane, endDrag is really simple:

protected function endDrag(event:MouseEvent):void {
        stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag);
    }

The stage var is the only thing that could be null here.

The only thing I can think to do is set scrollDrag=false before the window in my application closes so that nothing is listening for the event. Any other suggestions?

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3