Skip to main content
Participant
October 13, 2006
Question

inactive and reactivate a MouseListener

  • October 13, 2006
  • 1 reply
  • 178 views
Hello everyone,

1) on the _root level I have a code that adds a MouseListener :
something like that : Mouse.addListener(MouseListener)
that works fine...

2) on a deeper depth (under _root level) I have a button with the following code, to "inactivate" (delete) the MouseListener on the _root level
something like: Mouse.removeListener(_root.MouseListener)
that works fine

3) now... if I want to go back to the _root level (by clickin a button in the deeper depth) I want "REACTIVATE" the MouseListener . So I want to enable or to add the MouseListener again... I tried following code: Mouse.addListener(_root.MouseListener)
THIS CODE DOESN'T WORK!!! grrrrrrrrrrr....

Can anyone help me how to 'reactivate' (re-add) the MouseListener once I'm on _root level?

Thanks in advance...
Christophe.
This topic has been closed for replies.

1 reply

Known Participant
October 13, 2006
well is the MouseListener an Object? If so your code should work fine. The problem maybe that your MouseListener Object may no longer be in scope. You may have destroyed it or deleted it unintentionally.

What properties/functions are on the MouseListener?