
May 29th, 2011, 07:02 PM
|
|
|
|
ActionScript 3 - 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!?
|