Hi,
I think Sprite / MovieClip may have a "mouseChildren" property which
you can set to true / false, which I vaguely remember helped me before.
Problem is you won't get any further mouse events from it unless you
re-enable.
Or, the other option is to remove the event listener for rollover /
rollout when the button is clicked / becomes the current link.
Hope this helps?
Glen
Omar Fouad wrote:
Thanks Dave but No It does not change anything same problem.
On Tue, Apr 21, 2009 at 7:38 PM, Dave Watts <[email protected]> wrote:
this is a silly problem that, because it is silly, makes me nervous and
frustrate at the same time.
I've got a class (extends Sprite) that has embedded some MovieClips.
Those
MCs are actually containing textboxes with the name of the sections.
for each MC
MC.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
MC.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
private function onRollOut(e:MouseEvent):void {
//change colors here of e.currentTarget
}
private function onRollOver(e:MouseEvent):void {
//change colors here of e.currentTarget
}
In the Main Class I am adding the above class to the displayList and I
set
Click Listeners for each of its children
var CurrentLink:Sprite // assume it holds a reference of a link
var linkbar:LinkBar = new LinkBar();
linkBar.link1.addEventListener(MouseEvent.CLICK, onClick);
private function onClick(e:MouseEvent):void {
e.currentTarget.mouseEnabled = false;
CurrentLink.mouseEnabled = true;
CurrentLink = e.currentTarget;
}
The link clicked is now disabled but there is a little problem, the
CurrentLink still listens for RollOut events as its color change when i
take
the mouse off it. I think it shouldn't because I am setting its
mouseEnabled
to false.
I think that, for every rollover, there has to be a corresponding
rollout before you can effectively disable the event listener.
http://www.actionscript.org/forums/showthread.php3?t=157859
I could be wrong about this, and would welcome correction if that's the
case!
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders