all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

inactive and reactivate a MouseListener


inactive and reactivate a MouseListener tinderstick
10/13/2006 6:00:02 PM
flash actionscript: 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.

Re: inactive and reactivate a MouseListener VisionaryStudios
10/13/2006 6:26:35 PM
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?
AddThis Social Bookmark Button