|
-
Mouse_over
I'm working on a script that is about finished but I've reached a snag. I'm creating a gallery page, similar to Thickbox or Lightbox.
I have thumbnails off to the left and a UILoader on the right. When you click a thumbnail, the image loads on the left. Easy!
What I'm working on now is that if you hover over the right side of the image you get a NextBtn and on the left you'd get a PrevBtn.
The buttons are created and tween in on MOUSE_OVER like they are supposed to. The problem that I'm having is once you MOUSE_DOWN and the next image loads (also working properly) the Tween that is on the Prev/NextBtns resets to the OUT position until you mouse outside the rollover than back in. Is there any way to make the Tween stay IN until the mouse moves out?
excerpt from code:
prevOver.addEventListener(MouseEvent.MOUSE_OVER, activatePrevBtn);
nextOver.addEventListener(MouseEvent.MOUSE_OVER, activateNextBtn);
prevOver.addEventListener(MouseEvent.MOUSE_OUT, deactivatePrevBtn);
nextOver.addEventListener(MouseEvent.MOUSE_OUT, deactivateNextBtn);
prevOver.addEventListener(MouseEvent.MOUSE_DOWN, clickPrev);
nextOver.addEventListener(MouseEvent.MOUSE_DOWN, clickNext);
nextBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickNext);
prevBtn.addEventListener(MouseEvent.MOUSE_DOWN, clickPrev);
function activatePrevBtn(e:MouseEvent):void{
tweenPrevIn()
}
function activateNextBtn(e:MouseEvent):void{
tweenNextIn()
}
function deactivatePrevBtn(e:MouseEvent):void{
tweenPrevOut()
}
function deactivateNextBtn(e:MouseEvent):void{
tweenNextOut()
}
function clickNext(e:MouseEvent):void{
switch (currentImg) {
case 1:
mainLoader.ImageLoader.source="images/product/img2.jpg";
currentImg = 2;
break;
case 2:
mainLoader.ImageLoader.source="images/product/img3.jpg";
currentImg = 3;
break;
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|