hello all,
I have been creating the new nothingGrinder website in FLASH CS3 and AS3. AS3 is amazing and so much better than AS2, I'm just loving it. I have been trying to add a custom cursor on ROLL_OVER / MOUSE_OVER to my buttons. now, my buttons are constructed as small animations with movieclips inside movieclips inside movieclips. Each layer of movieclips being animated in a certain way. I have read multiple tutorials and classes that contain mouse rollover tooltips and cursors. the Flash Video Gallery thats provided by Adobe is something else i have been going through and copying code from. so, what i have now is a cursor that appears on rollover but the button is constantly going back and forth between OVER and OUT states and i cant figure out why...
here is the event handlers I'm using...
function mouseOverHandler(e:MouseEvent):void {
trace("mouseOverHandler");
Mouse.hide();
var tooltip = root["ourMouse"];
tooltip.x = root.mouseX;
tooltip.y = root.mouseY;
root["ourMouse"].visible = true;
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseOutHandler(e:MouseEvent):void {
trace("mouseOutHandler");
Mouse.show();
root["ourMouse"].visible = false;
removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseMoveHandler(e:MouseEvent):void {
var tooltip = root["ourMouse"];
tooltip.x = root.mouseX;
tooltip.y = root.mouseY;
//e.updateAfterEvent();
}
in the "mouseMoveHandler" method, if i change the tooltip.x and .y to e.localX and localY, the cursor appears in the top left corner of the stage, way off the button, but it doesn't blink and looks good, just bad positioning. So, the root.mouseX was taken from the Flash Video Gallery example but still blinks like crazy in my app.
the listeners I'm using are here...
function addListeners():void {
for (var i:Number = 0; i < btnA.length; i++) {
btnA[i].addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
btnA[i].addEventListener(MouseEvent.MOUSE_UP, mouseUp);
btnA[i].addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
btnA[i].addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
}
}
any help or ideas would be very much appreciated. Thank you.