Currently there is no way to remove the mouse listeners. You can add
these two functions to the body of the View3D class to create this
feature.
public function disableMouseListeners():void {
removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
}
public function enableMouseListeners():void {
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
}
And use them:
var view:View3D = new View3D();
view.disableMouseListeners();
view.enableMouseListeners();
How are you currently removing the view sprite from the stage? I've
done this several times in the past without any problems.
On Nov 11, 4:37 am, Daevid <[EMAIL PROTECTED]> wrote:
> I know this has been brought up before, but I really think there
> should be a dispose function in the view3d-class.
>
> I don't see any way to remove the mouse listeners in the view 3d
> without hacking the view3d-class (since the functions that it listens
> to are private), and sometimes I have timing issues where the mouse
> event occurs after view3d has been removed from the stage, causing an
> exception since the findhit function uses the stage.
>
> What do you think?
>
> /David Sjölander