> 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

Reply via email to