# Help needed. Mouse Over/Out

**URL:** <https://forum.kirupa.com/t/help-needed-mouse-over-out/318598>\
**Category:** flash\
**Created:** [January 25, 2011, 2:31am UTC](https://forum.kirupa.com/t/help-needed-mouse-over-out/318598 "2011-01-25T02:31:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeahy](https://avatars.discourse-cdn.com/v4/letter/y/3e96dc/32.png) [@Yeahy](https://forum.kirupa.com/u/Yeahy)\
**Post date:** [January 25, 2011, 2:31am UTC](https://forum.kirupa.com/t/help-needed-mouse-over-out/318598/1 "2011-01-25T02:31:21Z")

</div>

Hello. Currently I have a rotating globe with 2 buttons. when i click on “right” button, it will go to next frame. when i click on “left button”, it will go to prev frame. I have no problem making it rotating fully.

But now I’m trying to make the globe rotate itself when I mouse over the button. And globe will stop when I mouse out.

I’ve tried using a Boolean var and a while loop but I cant do it.

this is the current codes that i have.

stop();  
import flash.events.MouseEvent;

var mouseover:Boolean = false;

btnRight.addEventListener(MouseEvent.MOUSE\_OVER, onMouseOver\_next)  
btnRight.addEventListener(MouseEvent.MOUSE\_OUT, onMouseOut\_next)

function onMouseOver\_next(evt:MouseEvent):void  
{  
mouseover = false;  
while (mouseover == true){  
nextFrame();  
}  
}

function onMouseOut\_next(evt:MouseEvent):void  
{  
mouseover = false;  
stop();  
}

Am i doing it the right way? Or how do i go about doing this?
