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….
//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.