# Custom Cursor on MC ROLL\_OVER only help!

**URL:** https://forum.kirupa.com/t/custom-cursor-on-mc-roll-over-only-help/306001
**Category:** flash
**Created:** [March 7, 2010, 9:59pm UTC](https://forum.kirupa.com/t/custom-cursor-on-mc-roll-over-only-help/306001 "2010-03-07T21:59:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Terraform](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Terraform](https://forum.kirupa.com/u/Terraform)
#### Post date: [March 7, 2010, 9:59pm UTC](https://forum.kirupa.com/t/custom-cursor-on-mc-roll-over-only-help/306001/1 "2010-03-07T21:59:44Z")

</div>

hello  
I am having issues with making a script that will change the cursor to my custom cursor when it rolls over an invisible mc.

this is what I want.

I have a MC whose color is set to Alpha 0 which is placed over an area where  
I want on ROLL\_OVER the mouse to change to my custom cursor (which will indicate that a mouse click will “do something”)

this is what I have done.

```
1. created a MC that will be used as my Custom Cursor with alignment sent to center/middle (or center sq. in the grid)
2. I have exported it for AS
3. I have used the following code….

```

```auto

//roll over and roll out event handlers: (tgIcon_mc is the MC that I want to make active.)
tgIcon_mc.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); 
tgIcon_mc.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler); 

//this is our custom cursor 
var myCursor:cursor_mc = new cursor_mc(); 

//here we hide the mouse, and do the stuff we've talked about earlier in this thread 
function rollOverHandler(e:MouseEvent):void 
{ 
    Mouse.hide(); 
	myCursor.addEventListener(Event.ENTER_FRAME,enterFrameHandler); 
    addChild(myCursor); 
} 

//here we update the custom cursor's position 
function enterFrameHandler(e:Event):void 
{ 
    myCursor.x = mouseX; 
    myCursor.y = mouseY; 
} 
//if the cursor roles out of my_mc, we go back to the default cursor 
function rollOutHandler(e:MouseEvent):void 
{ 
   myCursor.removeEventListener(Event.ENTER_FRAME, enterFrameHandler); 
    removeChild(myCursor); 
	Mouse.show(); 
} 

```

now what is happening is it works BEAUTIFULLY with one BIG exception.  
the mouse icon strobes (about 20x / second) between the custom icon and the normal pointer one.

how do I remedy this situation?  
I am sure I am overlooking something silly.

thanks.
