#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    43
    Rep Power
    34

    Scroll Panes and Mouse Events...


    Hey Guys,

    I have another problem with my scroll pane.

    I now have a bunch of Loader objects that are used to display thumbnail images in a scrollpane. I want to add a MouseEvent.ROLL_OVER event so that when I a person rolls over an image there will be some buttons displayed, IE a remove button so the user can delete an image from the gallery.

    However my ROLL_OVER and ROLL_OUT events are firing like CRAZY when I place my mouse over a picture. Right now I have the roll over and roll out events set to just hide the image (so I know that it's working). But all that happens is the image flashes....

    here is the code...

    Code:
    var L : Loader = mThumbs[i].mLoader;
    L.addEventListener(MouseEvent.ROLL_OVER, onMouseOverThumb);
    
    ....
    
    public function onMouseOverThumb(event:MouseEvent) {
    	var thumb : Loader = event.target as Loader;
    	thumb.visible = false;
    	thumb.removeEventListener(MouseEvent.ROLL_OVER, onMouseOverThumb);
    	thumb.addEventListener(MouseEvent.ROLL_OUT, onMouseOutThumb);
    	trace("called mouse over....");
    }
    		
    		
    public function onMouseOutThumb(event:MouseEvent) {
    	var thumb : Loader = event.target as Loader;
    	thumb.visible = true;
    	thumb.addEventListener(MouseEvent.ROLL_OVER, onMouseOverThumb);
    	thumb.removeEventListener(MouseEvent.ROLL_OUT, onMouseOutThumb);
    	trace("called mouse out....");
    }
    So my question is how come my image is flashing!?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    43
    Rep Power
    34
    nevermind I'm st000pid.

    The image is flashing because when I call thumb.visible = false it's automatically forcing a mouse out event which then brings the thumb back into view and the cycle repeats!

    Sometimes the most simple problems can cause headaches :P

IMN logo majestic logo threadwatch logo seochat tools logo